Skip to content
Browse files

test for PendingReleaseController

  • Loading branch information...
1 parent 5755969 commit e6cb34a2812cd597d7c585d4b3ddf95daf606264 @graemerocher graemerocher committed
Showing with 16 additions and 11 deletions.
  1. +16 −11 test/unit/org/grails/plugin/PendingReleaseControllerSpec.groovy
View
27 test/unit/org/grails/plugin/PendingReleaseControllerSpec.groovy
@@ -5,22 +5,27 @@ import static org.junit.Assert.*
import grails.test.mixin.*
import grails.test.mixin.support.*
import org.junit.*
-
+import org.grails.maven.*
/**
* See the API for {@link grails.test.mixin.support.GrailsUnitTestMixin} for usage instructions
*/
-@TestMixin(GrailsUnitTestMixin)
-class PendingReleaseControllerSpec {
+@TestFor(PendingReleaseController)
+@Mock(PendingRelease)
+class PendingReleaseControllerSpec extends spock.lang.Specification{
- void setUp() {
- // Setup logic here
- }
- void tearDown() {
- // Tear down logic here
- }
+ void "Test deploy action"() {
+ given:"A pending release"
+ def pr = new PendingRelease(pluginName:"tomcat", pluginVersion:"1.0.0", zip:"dummy".bytes, pom:"dummy".bytes, xml:"dummy".bytes)
+
+ assert pr.save( flush:true)
+
+ PluginDeployService pluginDeployService = Mock()
+ controller.pluginDeployService = pluginDeployService
+ when:"The deploy action is called"
+ controller.deploy(pr.id)
- void testSomething() {
- fail "Implement me"
+ then:"The deploy service is invoked"
+ 1 * pluginDeployService.deployRelease(pr)
}
}

0 comments on commit e6cb34a

Please sign in to comment.
Something went wrong with that request. Please try again.