diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-09-18 10:26:05 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-09-18 10:26:05 +0100 |
commit | 40a28fa2fe21d752a15c11938791d620dd31d17f (patch) | |
tree | c94ceb14caaa5f683d1b74813ba2a999142f376a /spec/models/info_request_spec.rb | |
parent | 399d638bdf583b4166b8ab87818509a6c5375e78 (diff) | |
parent | 9f9f60106e8e65a5fd7ba5c979e87c03413518f1 (diff) |
Merge branch 'hotfix/0.13.0.3' into wdtk
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 6c292acf4..71c3775ec 100644 --- a/spec/models/info_request_spec.rb +++ b/spec/models/info_request_spec.rb @@ -423,6 +423,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 |