diff options
author | Francis Irving <francis@mysociety.org> | 2010-07-27 02:07:59 +0100 |
---|---|---|
committer | Francis Irving <francis@mysociety.org> | 2010-07-27 02:07:59 +0100 |
commit | 0cab4ce2f7d7f9d5171886e89441bb402400a6ff (patch) | |
tree | fa3ea2cbac80bf56a9c51844930a81dec8b9f58e | |
parent | 4cb9a7e35e29624afe6c866a8e4408aea49c67e0 (diff) |
Fix mocked test of charity number
-rw-r--r-- | spec/views/public_body/show.rhtml_spec.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/views/public_body/show.rhtml_spec.rb b/spec/views/public_body/show.rhtml_spec.rb index 5fec84af4..64f5b99b9 100644 --- a/spec/views/public_body/show.rhtml_spec.rb +++ b/spec/views/public_body/show.rhtml_spec.rb @@ -8,7 +8,6 @@ describe "when viewing a body" do :short_name => 'tq', :url_name => 'testquango', :notes => '', - :charity_number => '', :type_of_authority => 'A public body', :eir_only? => nil, :info_requests => [1, 2, 3, 4], # out of sync with Xapian @@ -16,6 +15,7 @@ describe "when viewing a body" do :calculated_home_page => '') @pb.stub!(:is_requestable?).and_return(true) @pb.stub!(:has_notes?).and_return(false) + @pb.stub!(:has_tag?).and_return(false) @xap = mock_model(ActsAsXapian::Search, :matches_estimated => 2) @xap.stub!(:results).and_return([ { :model => mock_event }, @@ -63,7 +63,9 @@ describe "when viewing a body" do end it "should link to Charity Commission site if we have a number" do - @pb.stub!(:charity_number).and_return('98765') + @pb.stub!(:has_tag?).and_return(true) + @pb.stub!(:get_tag_value).and_return('98765') + render "public_body/show" response.should have_tag("div#request_sidebar") do with_tag("a[href*=?]", /charity-commission.gov.uk.*RegisteredCharityNumber=98765$/) @@ -71,7 +73,9 @@ describe "when viewing a body" do end it "should link to Scottish Charity Regulator site if we have an SC number" do - @pb.stub!(:charity_number).and_return('SC1234') + @pb.stub!(:has_tag?).and_return(true) + @pb.stub!(:get_tag_value).and_return('SC1234') + render "public_body/show" response.should have_tag("div#request_sidebar") do with_tag("a[href*=?]", /www.oscr.org.uk.*id=SC1234$/) |