fix randomly failing specs
This commit is contained in:
parent
a4b658920e
commit
dd1cc23caf
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue