Commit a3936595 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Fix flaky spec due to indeterminate record order

Changes the assertion to use `contain_exactly` because the labels can be
returned from the DB in any order
parent 0991f5a7
...@@ -51,7 +51,7 @@ RSpec.describe Mutations::Boards::Update do ...@@ -51,7 +51,7 @@ RSpec.describe Mutations::Boards::Update do
board.resource_parent.add_reporter(user) board.resource_parent.add_reporter(user)
end end
it 'updates issue with correct values' do it 'updates board with correct values' do
expected_attributes = { expected_attributes = {
name: 'Test board 1', name: 'Test board 1',
hide_backlog_list: true, hide_backlog_list: true,
...@@ -59,7 +59,7 @@ RSpec.describe Mutations::Boards::Update do ...@@ -59,7 +59,7 @@ RSpec.describe Mutations::Boards::Update do
weight: 3, weight: 3,
assignee: user, assignee: user,
milestone: milestone, milestone: milestone,
labels: [label1, label2] labels: contain_exactly(label1, label2)
} }
subject subject
...@@ -76,7 +76,7 @@ RSpec.describe Mutations::Boards::Update do ...@@ -76,7 +76,7 @@ RSpec.describe Mutations::Boards::Update do
it 'updates board with correct labels' do it 'updates board with correct labels' do
subject subject
expect(board.reload.labels.pluck(:title)).to eq(new_labels) expect(board.reload.labels.pluck(:title)).to match_array(new_labels)
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment