fix randomly failing specs

This commit is contained in:
Régis Hanol 2017-03-27 22:47:41 +02:00
parent a4b658920e
commit dd1cc23caf
1 changed files with 6 additions and 6 deletions

View File

@ -198,7 +198,7 @@ describe TopicsBulkAction do
topic_ids = tba.perform! topic_ids = tba.perform!
expect(topic_ids).to eq([topic.id]) expect(topic_ids).to eq([topic.id])
topic.reload topic.reload
expect(topic.tags.map(&:name).sort).to eq(['newtag', tag1.name].sort) expect(topic.tags.map(&:name)).to contain_exactly('newtag', tag1.name)
end end
it "can change the tags but not create new ones" do it "can change the tags but not create new ones" do
@ -207,7 +207,7 @@ describe TopicsBulkAction do
topic_ids = tba.perform! topic_ids = tba.perform!
expect(topic_ids).to eq([topic.id]) expect(topic_ids).to eq([topic.id])
topic.reload topic.reload
expect(topic.tags.map(&:name)).to eq([tag1.name]) expect(topic.tags.map(&:name)).to contain_exactly(tag1.name)
end end
it "can remove all tags" do it "can remove all tags" do
@ -251,7 +251,7 @@ describe TopicsBulkAction do
topic_ids = tba.perform! topic_ids = tba.perform!
expect(topic_ids).to eq([topic.id]) expect(topic_ids).to eq([topic.id])
topic.reload topic.reload
expect(topic.tags.map(&:name).sort).to eq([tag1.name, tag2.name, tag3.name, 'newtag'].sort) expect(topic.tags.map(&:name)).to contain_exactly(tag1.name, tag2.name, tag3.name, 'newtag')
end end
it "can append empty tags" do it "can append empty tags" do
@ -259,7 +259,7 @@ describe TopicsBulkAction do
topic_ids = tba.perform! topic_ids = tba.perform!
expect(topic_ids).to eq([topic.id]) expect(topic_ids).to eq([topic.id])
topic.reload topic.reload
expect(topic.tags.map(&:name).sort).to eq([tag1.name, tag2.name].sort) expect(topic.tags.map(&:name)).to contain_exactly(tag1.name, tag2.name)
end end
context "when the user can't create new topics" do context "when the user can't create new topics" do
@ -272,7 +272,7 @@ describe TopicsBulkAction do
topic_ids = tba.perform! topic_ids = tba.perform!
expect(topic_ids).to eq([topic.id]) expect(topic_ids).to eq([topic.id])
topic.reload topic.reload
expect(topic.tags.map(&:name)).to eq([tag1.name, tag2.name, tag3.name]) expect(topic.tags.map(&:name)).to contain_exactly(tag1.name, tag2.name, tag3.name)
end end
end end
@ -286,7 +286,7 @@ describe TopicsBulkAction do
topic_ids = tba.perform! topic_ids = tba.perform!
expect(topic_ids).to eq([]) expect(topic_ids).to eq([])
topic.reload topic.reload
expect(topic.tags.map(&:name).sort).to eq([tag1.name, tag2.name].sort) expect(topic.tags.map(&:name)).to contain_exactly(tag1.name, tag2.name)
end end
end end
end end