aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/admin_public_body_controller_spec.rb
diff options
context:
space:
mode:
authorDavid Cabo <david@calibea.com>2011-08-17 00:51:36 +0200
committerDavid Cabo <david@calibea.com>2011-08-17 00:51:36 +0200
commit81874e161216fa515f0d0806a051b707cc5d96a7 (patch)
tree0cb9c8c724ff5414b4a9accf920ecb21a42cb61a /spec/controllers/admin_public_body_controller_spec.rb
parent1bc434b0822757ce5c86a7b53d0189ba2c7cd0d1 (diff)
Make public body creation tests more robust
Diffstat (limited to 'spec/controllers/admin_public_body_controller_spec.rb')
-rw-r--r--spec/controllers/admin_public_body_controller_spec.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/controllers/admin_public_body_controller_spec.rb b/spec/controllers/admin_public_body_controller_spec.rb
index 64eb45288..67832cb0e 100644
--- a/spec/controllers/admin_public_body_controller_spec.rb
+++ b/spec/controllers/admin_public_body_controller_spec.rb
@@ -149,6 +149,8 @@ describe AdminPublicBodyController, "when creating public bodies with i18n" do
username = MySociety::Config.get('ADMIN_USERNAME', '')
password = MySociety::Config.get('ADMIN_PASSWORD', '')
basic_auth_login @request
+
+ ActionController::Routing::Routes.filters.clear # don't auto-insert locale, complicates assertions
end
it "creates a new public body in one locale" do
@@ -157,7 +159,7 @@ describe AdminPublicBodyController, "when creating public bodies with i18n" do
PublicBody.count.should == 3
body = PublicBody.find_by_name("New Quango")
- response.should redirect_to("http://test.host/en/admin/body/show/#{body.id}")
+ response.should redirect_to(:controller=>'admin_public_body', :action=>'show', :id=>body.id)
end
it "creates a new public body with multiple locales" do
@@ -179,7 +181,7 @@ describe AdminPublicBodyController, "when creating public bodies with i18n" do
body.url_name.should == "nuevo_quango"
end
- response.should redirect_to("http://test.host/en/admin/body/show/#{body.id}")
+ response.should redirect_to(:controller=>'admin_public_body', :action=>'show', :id=>body.id)
end
# when submitting the 'new' form, we should ignore a locale if the user hasn't set any value in it