Remove isolated data creation useless assignments

While there are other variables in these tests, they're not part of the
setup of the test, and so these ones can be removed while keeping the
code easy to read.
This commit is contained in:
Javi Martín
2019-09-23 19:12:04 +02:00
parent 7b0771106e
commit ee0031ccb3
3 changed files with 22 additions and 22 deletions

View File

@@ -51,7 +51,7 @@ describe UserSegments do
describe "#proposal_authors" do
it "returns users that have created a proposal" do
proposal = create(:proposal, author: user1)
create(:proposal, author: user1)
proposal_authors = UserSegments.proposal_authors
expect(proposal_authors).to include user1
@@ -59,8 +59,8 @@ describe UserSegments do
end
it "does not return duplicated users" do
proposal1 = create(:proposal, author: user1)
proposal2 = create(:proposal, author: user1)
create(:proposal, author: user1)
create(:proposal, author: user1)
proposal_authors = UserSegments.proposal_authors
expect(proposal_authors).to contain_exactly(user1)