grails-2.0.4

Grails Spock integration test redirectedUrl different between localhost test-app and build server test-app

余生长醉 提交于 2019-12-13 00:56:27
问题 I have a Spock integration test that looks something like this: class PriceTierControllerIntegrationSpec extends IntegrationSpec { PriceTierController controller def setup() { controller = new PriceTierController() } def "applyDiscount() method will redirect user to success view"() { when: controller.applyDiscount() then: controller.response.redirectedUrl == '/priceTier/success' } Then in the controller, the logic is simply: class PriceTierController { def applyDiscount() { redirect action: