aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/models/public_body_category_spec.rb29
-rw-r--r--spec/models/public_body_heading_spec.rb20
-rw-r--r--spec/spec_helper.rb1
-rw-r--r--spec/views/public_body/show.html.erb_spec.rb34
4 files changed, 2 insertions, 82 deletions
diff --git a/spec/models/public_body_category_spec.rb b/spec/models/public_body_category_spec.rb
index 96fe5686b..c16c9b8a1 100644
--- a/spec/models/public_body_category_spec.rb
+++ b/spec/models/public_body_category_spec.rb
@@ -9,35 +9,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe PublicBodyCategory do
- describe 'when loading the data' do
- it 'should use the display_order field to preserve the original data order' do
- PublicBodyCategory.add(:en, [
- "Local and regional",
- [ "local_council", "Local councils", "a local council" ],
- "Miscellaneous",
- [ "other", "Miscellaneous", "miscellaneous" ],
- [ "aardvark", "Aardvark", "daft test"],])
-
- headings = PublicBodyHeading.all
- cat_group1 = headings[0].public_body_categories
- cat_group1.count.should eq 1
- cat_group1[0].title.should eq "Local councils"
-
- cat_group2 = headings[1].public_body_categories
- cat_group2.count.should eq 2
- cat_group2[0].title.should eq "Miscellaneous"
- cat_group2[0].public_body_category_links.where(
- :public_body_heading_id => headings[1].id).
- first.
- category_display_order.should eq 0
-
- cat_group2[1].title.should eq "Aardvark"
- cat_group2[1].public_body_category_links.where(
- :public_body_heading_id => headings[1].id).
- first.
- category_display_order.should eq 1
- end
- end
context 'when validating' do
diff --git a/spec/models/public_body_heading_spec.rb b/spec/models/public_body_heading_spec.rb
index 9372e0a07..620f7da9c 100644
--- a/spec/models/public_body_heading_spec.rb
+++ b/spec/models/public_body_heading_spec.rb
@@ -10,26 +10,6 @@ require 'spec_helper'
describe PublicBodyHeading do
- context 'when loading the data' do
-
- before do
- PublicBodyCategory.add(:en, [
- "Local and regional",
- [ "local_council", "Local councils", "a local council" ],
- "Miscellaneous",
- [ "other", "Miscellaneous", "miscellaneous" ],])
- end
-
- it 'should use the display_order field to preserve the original data order' do
- headings = PublicBodyHeading.all
- headings[0].name.should eq 'Local and regional'
- headings[0].display_order.should eq 0
- headings[1].name.should eq 'Miscellaneous'
- headings[1].display_order.should eq 1
- end
-
- end
-
context 'when validating' do
it 'should require a name' do
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 74a4891c2..93bcfa1ba 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -18,6 +18,7 @@ SimpleCov.start('rails') do
add_filter 'lib/has_tag_string'
add_filter 'lib/acts_as_xapian'
add_filter 'lib/themes'
+ add_filter '.bundle'
end
Spork.prefork do
diff --git a/spec/views/public_body/show.html.erb_spec.rb b/spec/views/public_body/show.html.erb_spec.rb
index ce01d2e8b..6ebc39caa 100644
--- a/spec/views/public_body/show.html.erb_spec.rb
+++ b/spec/views/public_body/show.html.erb_spec.rb
@@ -44,7 +44,7 @@ describe "public_body/show" do
it "should tell total number of requests" do
render
- response.should match "4 Freedom of Information requests"
+ response.should match "4 requests"
end
it "should cope with no results" do
@@ -59,38 +59,6 @@ describe "public_body/show" do
response.should match "The search index is currently offline"
end
- it "should link to Charity Commission site if we have numbers to do so" do
- @pb.stub!(:has_tag?).and_return(true)
- @pb.stub!(:get_tag_values).and_return(['98765', '12345'])
-
- render
- response.should have_selector("div#header_right") do
- have_selector "a", :href => /charity-commission.gov.uk.*RegisteredCharityNumber=98765$/
- end
- response.should have_selector("div#header_right") do
- have_selector "a", :href => /www.charity-commission.gov.uk.*RegisteredCharityNumber=12345$/
- end
- end
-
- it "should link to Scottish Charity Regulator site if we have an SC number" do
- @pb.stub!(:has_tag?).and_return(true)
- @pb.stub!(:get_tag_values).and_return(['SC1234'])
-
- render
- response.should have_selector("div#header_right") do
- have_selector "a", :href => /www.oscr.org.uk.*id=SC1234$/
- end
- end
-
-
- it "should not link to Charity Commission site if we don't have number" do
- render
- response.should have_selector("div#header_right") do
- have_selector "a", :href => /charity-commission.gov.uk/
- end
- end
-
-
end
def mock_event