From 338fecc7c788f921d9d7166625d6bb7512c54d4c Mon Sep 17 00:00:00 2001 From: voodoorai2000 Date: Sat, 1 Jun 2019 16:15:29 +0200 Subject: [PATCH] Use retired trait in specs This fixes a validation error being raised in these specs, as we were missing some attributes that are required. Using the factory trait the missing attributes are correctly filled out. --- spec/lib/user_segments_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/lib/user_segments_spec.rb b/spec/lib/user_segments_spec.rb index ed52dcfe7..e634076cb 100644 --- a/spec/lib/user_segments_spec.rb +++ b/spec/lib/user_segments_spec.rb @@ -31,7 +31,7 @@ describe UserSegments do it "returns users that have created a proposal even if is archived or retired" do create(:proposal, author: user1) create(:proposal, :archived, author: user2) - create(:proposal, retired_at: Time.current, author: user3) + create(:proposal, :retired, author: user3) all_proposal_authors = described_class.all_proposal_authors expect(all_proposal_authors).to include user1 @@ -42,7 +42,7 @@ describe UserSegments do it "does not return duplicated users" do create(:proposal, author: user1) create(:proposal, :archived, author: user1) - create(:proposal, retired_at: Time.current, author: user1) + create(:proposal, :retired, author: user1) all_proposal_authors = described_class.all_proposal_authors expect(all_proposal_authors).to contain_exactly(user1)