aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/public_body_controller_spec.rb5
-rw-r--r--spec/spec_helper.rb8
2 files changed, 12 insertions, 1 deletions
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')
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 065d9d080..fbc115c38 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -190,3 +190,11 @@ end
def parse_all_incoming_messages
IncomingMessage.find(:all).each{|x| x.parse_raw_email!}
end
+
+def load_test_categories
+ PublicBodyCategories.add(:en, [
+ "Local and regional",
+ [ "local_council", "Local councils", "a local council" ],
+ "Miscellaneous",
+ [ "other", "Miscellaneous", "miscellaneous" ],])
+end