Using the new test mixins?
> --
> You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
> To post to this group, send email to spockfr...@googlegroups.com.
> To unsubscribe from this group, send email to spockframewor...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.
>
> This is a unit test for a controller and I am using
> @TestFor(AwesomeController)
> @Mock(DomainClassFoo)
>
> forwardArgs and redirectArgs still appear to be unavailable.
>
> I know I'm likely missing (i.e. misunderstanding) something... just
> not sure what.
The beauty of these mixins is that they are not Spock specific. You'll have more chance of getting an answer on the Grails list.
I too ran into this when using Grails 2.0 for the first time and
you're right that this is the only way to test it - with
redirectedUrl. I actually raised a JIRA
(http://jira.grails.org/browse/GRAILS-7969) on this issue asking for
the original approach to be made available again as I take issue with
using redirectedUrl. That's testing the UrlMapping as well as the
controller, and I'd like to be able to change my URL mappings without
breaking all my controller unit tests. That's in some senses the whole
point of that particular abstraction after all, if you ask me.
Please vote for the JIRA issue if you agree.
Sam
> --
> You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
> To post to this group, send email to spockfr...@googlegroups.com.
> To unsubscribe from this group, send email to spockframewor...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.
>
--
Howard M. Lewis Ship
Creator of Apache Tapestry
The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!