Skip to content

Commit

Permalink
Merge pull request #268 from jdaugherty/7.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jdaugherty authored Nov 21, 2024
2 parents 4b29fd9 + 2da9094 commit 82d13af
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,38 @@ package functionaltests

import grails.plugin.geb.ContainerGebSpec
import grails.testing.mixin.integration.Integration
import org.testcontainers.images.builder.Transferable
import spock.lang.PendingFeature

/**
*/
@Integration(applicationClass = Application)
class UploadControllerSpec extends ContainerGebSpec {

@PendingFeature(reason='text is null')
@PendingFeature(reason='https://github.com/grails/grails-core/issues/13849')
void "Test file upload"() {
when:"When go to an upload page"
go "/upload/index"
go "/upload/index"

def f = File.createTempFile("uploadtest", "txt")
f.deleteOnExit()
f.text = "Test upload"
def form = $('#myForm')
getContainer().copyFileToContainer(Transferable.of("Test upload", 0777), "/test.txt")
def form = $('#myForm')

form.myFile = f.absolutePath
$('#input1').click()
form.myFile = "/test.txt"
$('#input1').click()

then:"The file is uploaded"
$('p').text() == 'Test upload'

$('p').text() == 'Test upload'
}

@PendingFeature(reason='text is null')
@PendingFeature(reason='https://github.com/grails/grails-core/issues/13849')
void "Test file upload parameters"() {
when:"When go to an upload page"
go "/upload/index"

def f = File.createTempFile("uploadtest", "txt")
f.deleteOnExit()
f.text = "Test upload"
getContainer().copyFileToContainer(Transferable.of("Test upload", 0777), "/test.txt")
def form = $('#myForm2')

form.myFile = f.absolutePath
form.myFile = "/test.txt"
$('#input2').click()

then:"The file is uploaded"
Expand Down
3 changes: 0 additions & 3 deletions app1/src/test/groovy/functionaltests/BookHibernateSpec.groovy
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package functionaltests

import spock.lang.Ignore

class BookHibernateSpec extends grails.test.hibernate.HibernateSpec {
def setup() {
new Book(title: 'foo').save()
}

@Ignore('Either class [functionaltests.Book] is not a domain class or GORM has not been initialized correctly or has already been shutdown. Ensure GORM is loaded and configured correctly before calling any methods on a GORM entity.')
void "Test that dynamic finders work"() {
expect:"The book validates"
Book.count() == 1
Expand Down

0 comments on commit 82d13af

Please sign in to comment.