aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/info_request_spec.rb8
-rw-r--r--spec/models/public_body_spec.rb14
2 files changed, 22 insertions, 0 deletions
diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb
index e931624c1..f5c92e5f6 100644
--- a/spec/models/info_request_spec.rb
+++ b/spec/models/info_request_spec.rb
@@ -341,6 +341,14 @@ describe InfoRequest do
InfoRequest.find_old_unclassified(:limit => 5)
end
+ it 'should ask for requests using any offset param supplied' do
+ InfoRequest.should_receive(:find).with(:all, {:select => anything,
+ :order => anything,
+ :conditions=> anything,
+ :offset => 100})
+ InfoRequest.find_old_unclassified(:offset => 100)
+ end
+
it 'should not limit the number of requests returned by default' do
InfoRequest.should_not_receive(:find).with(:all, {:select => anything,
:order => anything,
diff --git a/spec/models/public_body_spec.rb b/spec/models/public_body_spec.rb
index 9e22a9c43..011824190 100644
--- a/spec/models/public_body_spec.rb
+++ b/spec/models/public_body_spec.rb
@@ -407,6 +407,7 @@ describe PublicBody, " when loading CSV files" do
end
describe PublicBody do
+
describe "calculated home page" do
it "should return the home page verbatim if it's present" do
public_body = PublicBody.new
@@ -438,4 +439,17 @@ describe PublicBody do
public_body.calculated_home_page.should == "https://example.com"
end
end
+
+ describe 'when asked for notes without html' do
+
+ before do
+ @public_body = PublicBody.new(:notes => 'some <a href="/notes">notes</a>')
+ end
+
+ it 'should remove simple tags from notes' do
+ @public_body.notes_without_html.should == 'some notes'
+ end
+
+ end
+
end