sgo / grails-functional-spock

Write Grails functional tests with Spock
2 stars 2 forks source link

Web-app does not appear to run during functional phase #6

Open djoodle opened 9 years ago

djoodle commented 9 years ago

The web-app under test doesn't appear to actually start up when running in the functional test phase using the functional-spock plugin. I'm trying to use HTTPBuilder to test XML-RPC API:

Functional-Spock: 0.7 Grails: 2.3.8

BuildConfig.groovy: compile ':functional-spock:0.7'

ExampleTestSpec.groovy:

class ExampleTestSpec extends Specification {
     def "test post to webapp url"() {
       when:
         groovyx.net.http.HTTPBuilder('http://localhost:9000/example-app').get(path:'/') { resp, reader ->
           println "resp.status"
         }

       then:
         true
     }
}

The above test throws a HttpResponseException: Not Found

During the test I cannot wget the page, 404 response.