PageRenderTime 25ms CodeModel.GetById 17ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/test/unit/PlanningPokerControllerSpec.groovy

http://github.com/icescrum/iceScrum-plugin-planning-poker
Groovy | 41 lines | 26 code | 9 blank | 6 comment | 1 complexity | 95d39a37d35d83e0f57c66da50328e80 MD5 | raw file
 1/**
 2 * Created by IntelliJ IDEA.
 3 * Date: 25/02/11
 4 * Time: 15:56
 5 * To change this template use File | Settings | File Templates.
 6 */
 7
 8import grails.plugin.spock.*
 9import org.icescrum.core.domain.Product
10import org.icescrum.core.domain.preferences.ProductPreferences
11import icescrum.plugin.planning.poker.PlanningPokerSession
12import icescrum.plugin.planning.poker.PlanningPokerService
13
14class PlanningPokerControllerSpec extends ControllerSpec {
15
16 def setup(){
17
18   mockDomain(Product)
19   mockDomain(PlanningPokerSession)
20   def planningPokerService = new PlanningPokerService()
21
22     controller.planningPokerService = planningPokerService
23
24     def p = new Product(name: 'testProj')
25   p.pkey = 'TESTPROJ'
26   p.startDate = new Date().parse('yyyy-M-d', String.format('%tF', new Date()))
27   p.preferences = new ProductPreferences()
28   p.save()
29   def params = [product:p.id]
30   controller.params.product = p.id
31
32  }
33
34  def 'index planning poker'(){
35    when:
36    controller.index()
37
38    then:
39    renderArgs == [template:'window/blank',plugin:'icescrum-plugin-planning-poker' ,model:[id:'planningPoker']]
40  }
41}