Created
February 21, 2016 17:57
-
-
Save ishults/a071e657b42ef04e8e72 to your computer and use it in GitHub Desktop.
The broken unit tests for our filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Mock(UriFilters) | |
@TestFor(MyController)// Need a controller to test filters | |
class UriFiltersSpec extends Specification { | |
void "myFilter() should set the names of the controller and action"() { | |
when: | |
withFilters(uri: '/some/path/**') { controller.index() } | |
then: | |
response.getHeader('controllerName') == 'my' | |
response.getHeader('actionName') == 'index' | |
response.contentAsString == 'success' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment