aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/admin_public_body_controller_spec.rb8
-rw-r--r--spec/controllers/public_body_controller_spec.rb5
2 files changed, 11 insertions, 2 deletions
diff --git a/spec/controllers/admin_public_body_controller_spec.rb b/spec/controllers/admin_public_body_controller_spec.rb
index 261f8b695..7af637c1c 100644
--- a/spec/controllers/admin_public_body_controller_spec.rb
+++ b/spec/controllers/admin_public_body_controller_spec.rb
@@ -8,8 +8,14 @@ describe AdminPublicBodyController, "when administering public bodies" do
username = MySociety::Config.get('ADMIN_USERNAME', '')
password = MySociety::Config.get('ADMIN_PASSWORD', '')
basic_auth_login @request
+
+ @old_filters = ActionController::Routing::Routes.filters
+ ActionController::Routing::Routes.filters = RoutingFilter::Chain.new
end
+ after do
+ ActionController::Routing::Routes.filters = @old_filters
+ end
it "shows the index page" do
get :index
@@ -198,11 +204,11 @@ describe AdminPublicBodyController, "when creating public bodies with i18n" do
@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
n = PublicBody.count
post :create, { :public_body => { :name => "New Quango", :short_name => "", :tag_string => "blah", :request_email => 'newquango@localhost', :last_edit_comment => 'From test code' } }
diff --git a/spec/controllers/public_body_controller_spec.rb b/spec/controllers/public_body_controller_spec.rb
index 4d27ea3f5..06077ac60 100644
--- a/spec/controllers/public_body_controller_spec.rb
+++ b/spec/controllers/public_body_controller_spec.rb
@@ -1,3 +1,4 @@
+# -*- coding: undecided -*-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require 'json'
@@ -138,13 +139,15 @@ describe PublicBodyController, "when listing bodies" do
end
it "should list a tagged thing on the appropriate list page, and others on the other page, and all still on the all page" do
+ load_test_categories
+
public_bodies(:humpadink_public_body).tag_string = "foo local_council"
get :list, :tag => "local_council"
response.should render_template('list')
assigns[:public_bodies].should == [ public_bodies(:humpadink_public_body) ]
assigns[:tag].should == "local_council"
- assigns[:description].should == "Local councils"
+ assigns[:description].should == "in the category ‘Local councils’"
get :list, :tag => "other"
response.should render_template('list')