/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. import grails.plugin.spock.*
  8. import org.icescrum.core.domain.Product
  9. import org.icescrum.core.domain.preferences.ProductPreferences
  10. import icescrum.plugin.planning.poker.PlanningPokerSession
  11. import icescrum.plugin.planning.poker.PlanningPokerService
  12. class PlanningPokerControllerSpec extends ControllerSpec {
  13. def setup(){
  14. mockDomain(Product)
  15. mockDomain(PlanningPokerSession)
  16. def planningPokerService = new PlanningPokerService()
  17. controller.planningPokerService = planningPokerService
  18. def p = new Product(name: 'testProj')
  19. p.pkey = 'TESTPROJ'
  20. p.startDate = new Date().parse('yyyy-M-d', String.format('%tF', new Date()))
  21. p.preferences = new ProductPreferences()
  22. p.save()
  23. def params = [product:p.id]
  24. controller.params.product = p.id
  25. }
  26. def 'index planning poker'(){
  27. when:
  28. controller.index()
  29. then:
  30. renderArgs == [template:'window/blank',plugin:'icescrum-plugin-planning-poker' ,model:[id:'planningPoker']]
  31. }
  32. }