diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-09-18 10:36:05 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-09-18 10:36:05 +0100 |
commit | 46bdfbd5fc3c29968f139d0aac3064204b7e6058 (patch) | |
tree | 1cc6c0d263083d434c490ed218cf7927af81ffc6 /spec/models/info_request_spec.rb | |
parent | caf1fd8817e03a64535b7648a014017c45fe40fb (diff) | |
parent | 9f9f60106e8e65a5fd7ba5c979e87c03413518f1 (diff) |
Merge branch 'hotfix/0.13.0.3' into rails-3-develop
Diffstat (limited to 'spec/models/info_request_spec.rb')
-rw-r--r-- | spec/models/info_request_spec.rb | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb index fac89109c..7281b74b6 100644 --- a/spec/models/info_request_spec.rb +++ b/spec/models/info_request_spec.rb @@ -475,6 +475,43 @@ describe InfoRequest do end + describe 'when asked for random old unclassified requests with normal prominence' do + + it "should not return requests that don't have normal prominence" do + dog_request = info_requests(:fancy_dog_request) + old_unclassified = InfoRequest.get_random_old_unclassified(1, :conditions => ["prominence = 'normal'"]) + old_unclassified.length.should == 1 + old_unclassified.first.should == dog_request + dog_request.prominence = 'requester_only' + dog_request.save! + old_unclassified = InfoRequest.get_random_old_unclassified(1, :conditions => ["prominence = 'normal'"]) + old_unclassified.length.should == 0 + dog_request.prominence = 'hidden' + dog_request.save! + old_unclassified = InfoRequest.get_random_old_unclassified(1, :conditions => ["prominence = 'normal'"]) + old_unclassified.length.should == 0 + end + + end + + describe 'when asked to count old unclassified requests with normal prominence' do + + it "should not return requests that don't have normal prominence" do + dog_request = info_requests(:fancy_dog_request) + old_unclassified = InfoRequest.count_old_unclassified(:conditions => ["prominence = 'normal'"]) + old_unclassified.should == 1 + dog_request.prominence = 'requester_only' + dog_request.save! + old_unclassified = InfoRequest.count_old_unclassified(:conditions => ["prominence = 'normal'"]) + old_unclassified.should == 0 + dog_request.prominence = 'hidden' + dog_request.save! + old_unclassified = InfoRequest.count_old_unclassified(:conditions => ["prominence = 'normal'"]) + old_unclassified.should == 0 + end + + end + describe 'when an instance is asked if it is old and unclassified' do before do |