This project is archived and is in readonly mode.
multiple nested routes for same resource doesn't work in functional tests?
-
jemminger
- Tag set to routing error, functional, routingerror, testing
-
jemminger
- Title changed from multiple nested routes for same route doesn't work in functional tests? to multiple nested routes for same resource doesn't work in functional tests?
-
gnufied
Your functional test has code like:
class ContactsControllerTest < ActionController::TestCase test 'should get foo' do get :foo assert_response :success end test 'should get bar' do get :bar assert_response :success end endbut in your routes.rb, you have marked contacts as nested resource and hence isn't accessible directly. In short, accessing contacts resource directly doesn't work from browser, doesn't work from functional tests. There ain't anything wrong with behavior.
-
gnufied
- Tag changed from routing error, functional, routingerror, testing to routing error, functional, invalid, routingerror, testing
-
jemminger
Doh, you're right. Changing the tests like so fixes it:
test 'should get foo' do get :foo, :client_id => 1 assert_response :success end test 'should get bar' do get :bar, :tab_id => 1 assert_response :success endAnd this is how I've set up all my other tests, but for whatever reason brainfarted here and forgot.
-
Ryan Bigg
- State changed from new to invalid
