diff options
author | David Cabo <david@calibea.com> | 2011-08-17 00:51:36 +0200 |
---|---|---|
committer | David Cabo <david@calibea.com> | 2011-08-23 23:45:23 +0200 |
commit | 4b1d6f2baea450949047288e4dc76f4197b85b80 (patch) | |
tree | 4f408fd37fb3d9ae2fe1b1711590c9702e003f08 /spec/controllers/admin_public_body_controller_spec.rb | |
parent | b99b1ec3bc5242084c780082a6c737fb736991a8 (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.rb | 6 |
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 |