diff --git a/db/migrate/20140731191229_change_default_value_of_info_request_prominence.rb b/db/migrate/20140731191229_change_default_value_of_info_request_prominence.rb new file mode 100644 index 00000000000..0539dfd23c5 --- /dev/null +++ b/db/migrate/20140731191229_change_default_value_of_info_request_prominence.rb @@ -0,0 +1,5 @@ +class ChangeDefaultValueOfInfoRequestProminence < ActiveRecord::Migration + def change + change_default_column :info_requests, :prominence, "requester_only" + end +end diff --git a/spec/factories/info_requests.rb b/spec/factories/info_requests.rb index 8052625cd66..8c1efeb756f 100644 --- a/spec/factories/info_requests.rb +++ b/spec/factories/info_requests.rb @@ -3,6 +3,7 @@ factory :info_request do title "Example Title" public_body + prominence 'normal' user after_create do |info_request, evaluator| diff --git a/spec/fixtures/info_requests.yml b/spec/fixtures/info_requests.yml index d4fc050c6b8..73763c8ef60 100644 --- a/spec/fixtures/info_requests.yml +++ b/spec/fixtures/info_requests.yml @@ -36,6 +36,7 @@ fancy_dog_request: comments_allowed: true idhash: 50929748 address: Some address + prominence: normal naughty_chicken_request: id: 103 title: How much public money is wasted on breeding naughty chickens? @@ -49,6 +50,7 @@ naughty_chicken_request: comments_allowed: true idhash: e8d18c84 address: Some address + prominence: normal badger_request: id: 104 title: Are you really a badger? @@ -62,6 +64,7 @@ badger_request: comments_allowed: true idhash: e8d18c84 address: Some address + prominence: normal boring_request: id: 105 title: The cost of boring @@ -75,6 +78,7 @@ boring_request: comments_allowed: true idhash: 173fd003 address: Some address + prominence: normal another_boring_request: id: 106 title: The cost of boring @@ -88,6 +92,7 @@ another_boring_request: comments_allowed: true idhash: 173fd004 address: Some address + prominence: normal # A pair of identical requests (with url_title differing only in the numeric suffix) # used to test the request de-duplication features. @@ -104,6 +109,7 @@ spam_1_request: comments_allowed: false idhash: 173fd005 address: Some address + prominence: normal spam_2_request: id: 108 title: Cheap v1agra @@ -117,6 +123,7 @@ spam_2_request: comments_allowed: true idhash: 173fd005 address: Some address + prominence: normal external_request: id: 109 title: Balalas @@ -129,6 +136,7 @@ external_request: comments_allowed: true idhash: a1234567 address: Some address + prominence: normal anonymous_external_request: id: 110 title: Anonymous request @@ -141,6 +149,7 @@ anonymous_external_request: comments_allowed: true idhash: 7654321a address: Some address + prominence: normal other_request: id: 111 title: Another request @@ -154,3 +163,4 @@ other_request: comments_allowed: true idhash: b234567 address: Some address + prominence: normal diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb index 12499f50af1..086ba0f0e0c 100644 --- a/spec/models/info_request_spec.rb +++ b/spec/models/info_request_spec.rb @@ -28,6 +28,14 @@ describe InfoRequest do + it 'has "requester_only" default prominence' do + request = InfoRequest.new(:title => 'abcde', + :public_body => public_bodies(:geraldine_public_body), + :user_id => 1) + request.save! + request.prominence.should eq 'requester_only' + end + describe 'when validating' do it 'should accept a summary with ascii characters' do @@ -1120,7 +1128,8 @@ :external_user_name => 'Example User', :title => 'Some request or other', :described_state => 'partially_successful', - :public_body => pb) + :public_body => pb, + :prominence => 'normal') ir.save! pb.info_requests_successful_count.should == (old_successful_count + 1) ir.described_state = 'not_held'