aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/public_body_controller_spec.rb (renamed from spec/controllers/body_controller_spec.rb)8
-rw-r--r--spec/views/public_body/show.rhtml_spec.rb (renamed from spec/views/body/show.rhtml_spec.rb)16
2 files changed, 12 insertions, 12 deletions
diff --git a/spec/controllers/body_controller_spec.rb b/spec/controllers/public_body_controller_spec.rb
index 6d108c686..aae72dad9 100644
--- a/spec/controllers/body_controller_spec.rb
+++ b/spec/controllers/public_body_controller_spec.rb
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/../spec_helper'
-describe BodyController, "when showing a body" do
+describe PublicBodyController, "when showing a body" do
integrate_views
fixtures :public_bodies, :public_body_versions
@@ -21,16 +21,16 @@ describe BodyController, "when showing a body" do
it "should redirect to newest name if you use historic name of public body in URL" do
get :show, :url_name => "hdink"
- response.should redirect_to(:controller => 'body', :action => 'show', :url_name => "dfh")
+ response.should redirect_to(:controller => 'public_body', :action => 'show', :url_name => "dfh")
end
it "should redirect to lower case name if you use mixed case name in URL" do
get :show, :url_name => "dFh"
- response.should redirect_to(:controller => 'body', :action => 'show', :url_name => "dfh")
+ response.should redirect_to(:controller => 'public_body', :action => 'show', :url_name => "dfh")
end
end
-describe BodyController, "when listing bodies" do
+describe PublicBodyController, "when listing bodies" do
integrate_views
fixtures :public_bodies, :public_body_versions
diff --git a/spec/views/body/show.rhtml_spec.rb b/spec/views/public_body/show.rhtml_spec.rb
index 24f86aafb..fbd05b9d1 100644
--- a/spec/views/body/show.rhtml_spec.rb
+++ b/spec/views/public_body/show.rhtml_spec.rb
@@ -31,47 +31,47 @@ describe "when viewing a body" do
end
it "should be successful" do
- render "body/show"
+ render "public_body/show"
response.should be_success
end
it "should be valid HTML" do
- render "body/show"
+ render "public_body/show"
validate_as_body response.body
end
it "should show the body's name" do
- render "body/show"
+ render "public_body/show"
response.should have_tag("h1", "Test Quango")
end
it "should tell total number of requests" do
- render "body/show"
+ render "public_body/show"
response.should have_tag("h2", "4 Freedom of Information requests made")
end
it "should cope with no results" do
@xap.stub!(:results).and_return([])
- render "body/show"
+ render "public_body/show"
response.should have_tag("p", /Nobody has made any Freedom of Information requests/m)
end
it "should cope with Xapian being down" do
assigns[:xapian_requests] = nil
- render "body/show"
+ render "public_body/show"
response.should have_tag("p", /The search index is currently offline/m)
end
it "should link to Charity Commission site if we have a number" do
@pb.stub!(:charity_number).and_return('98765')
- render "body/show"
+ render "public_body/show"
response.should have_tag("div#request_sidebar") do
with_tag("a[href*=?]", /charity-commission.gov.uk.*RegisteredCharityNumber=98765$/)
end
end
it "should not link to Charity Commission site if we don't have number" do
- render "body/show"
+ render "public_body/show"
response.should have_tag("div#request_sidebar") do
without_tag("a[href*=?]", /charity-commission.gov.uk/)
end