diff options
author | Robin Houston <robin.houston@gmail.com> | 2012-01-20 12:10:15 +0000 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2012-01-20 12:10:15 +0000 |
commit | 34dad8557132bc730db8e502684f12e4c247c24d (patch) | |
tree | 1091587c85289cf0f4265dfb5e7c36351b26f368 /spec/helpers | |
parent | f596a8983ae514da5c41cfc280598f3946747c47 (diff) |
Be sure to restore RoutingFilters
There were some order-dependent test failures that turned out to
be caused by the fact that the RoutingFilters were cleared and
not subsequently restored, by some tests.
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/link_to_helper_spec.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/helpers/link_to_helper_spec.rb b/spec/helpers/link_to_helper_spec.rb index f85d2e70d..3fa91a8f8 100644 --- a/spec/helpers/link_to_helper_spec.rb +++ b/spec/helpers/link_to_helper_spec.rb @@ -7,9 +7,14 @@ describe LinkToHelper do describe 'when creating a url for a request' do before do - ActionController::Routing::Routes.filters.clear @mock_request = mock_model(InfoRequest, :url_title => 'test_title') + @old_filters = ActionController::Routing::Routes.filters + ActionController::Routing::Routes.filters = RoutingFilter::Chain.new end + after do + ActionController::Routing::Routes.filters = @old_filters + end + it 'should return a path like /request/test_title' do request_url(@mock_request).should == '/request/test_title' |