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/controllers/admin_public_body_controller_spec.rb | |
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/controllers/admin_public_body_controller_spec.rb')
-rw-r--r-- | spec/controllers/admin_public_body_controller_spec.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/controllers/admin_public_body_controller_spec.rb b/spec/controllers/admin_public_body_controller_spec.rb index 97636023a..2670f2add 100644 --- a/spec/controllers/admin_public_body_controller_spec.rb +++ b/spec/controllers/admin_public_body_controller_spec.rb @@ -198,8 +198,13 @@ describe AdminPublicBodyController, "when creating public bodies with i18n" do password = MySociety::Config.get('ADMIN_PASSWORD', '') basic_auth_login @request - ActionController::Routing::Routes.filters.clear # don't auto-insert locale, complicates assertions + @old_filters = ActionController::Routing::Routes.filters + ActionController::Routing::Routes.filters = RoutingFilter::Chain.new end + after do + ActionController::Routing::Routes.filters = @old_filters + end + it "creates a new public body in one locale" do PublicBody.count.should == 2 |