diff options
author | Gareth Rees <gareth@mysociety.org> | 2015-04-29 14:47:34 +0100 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2015-05-12 16:13:16 +0100 |
commit | f3c6f513bc75516f7ba70c04a9ecef78d6d14ac9 (patch) | |
tree | c1d4bcdc155856387505a4c9ecaa04b0239782a9 | |
parent | dd00661123379ccb508a7422b152c17769f7501d (diff) |
Use a sequence for InfoRequest factory
Avoids unique name constraint
-rw-r--r-- | spec/factories/info_requests.rb | 2 | ||||
-rw-r--r-- | spec/integration/download_request_spec.rb | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/spec/factories/info_requests.rb b/spec/factories/info_requests.rb index 8052625cd..ee96bfa89 100644 --- a/spec/factories/info_requests.rb +++ b/spec/factories/info_requests.rb @@ -1,7 +1,7 @@ FactoryGirl.define do factory :info_request do - title "Example Title" + sequence(:title) { |n| "Example Title #{n}" } public_body user diff --git a/spec/integration/download_request_spec.rb b/spec/integration/download_request_spec.rb index 48b42b11d..c73b85866 100644 --- a/spec/integration/download_request_spec.rb +++ b/spec/integration/download_request_spec.rb @@ -143,7 +143,8 @@ describe 'when making a zipfile available' do it "should update the contents of the zipfile when the request changes" do - info_request = FactoryGirl.create(:info_request_with_incoming) + info_request = FactoryGirl.create(:info_request_with_incoming, + :title => 'Example Title') request_owner = login(info_request.user) inspect_zip_download(request_owner, info_request) do |zip| zip.count.should == 1 # just the message |