Commit 459e922a authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Fixes flaky spec due to result ordering

When we switched the order to use star_count we added a new test but
forgot to update these old tests
parent 6df4c4bd
......@@ -22,14 +22,14 @@ RSpec.describe Autocomplete::MoveToProjectFinder do
expect(finder.execute).to be_empty
end
it 'returns projects equal or above Gitlab::Access::REPORTER ordered by name' do
it 'returns projects equal or above Gitlab::Access::REPORTER' do
reporter_project.add_reporter(user)
developer_project.add_developer(user)
maintainer_project.add_maintainer(user)
finder = described_class.new(user, project_id: project.id)
expect(finder.execute.to_a).to eq([reporter_project, developer_project, maintainer_project])
expect(finder.execute.to_a).to contain_exactly(reporter_project, developer_project, maintainer_project)
end
it 'does not include the source project' do
......@@ -88,10 +88,10 @@ RSpec.describe Autocomplete::MoveToProjectFinder do
wadus_project.add_maintainer(user)
expect(described_class.new(user, project_id: project.id).execute.to_a)
.to eq([foo_project, wadus_project])
.to contain_exactly(foo_project, wadus_project)
expect(described_class.new(user, project_id: project.id, search: 'wadus').execute.to_a)
.to eq([wadus_project])
.to contain_exactly(wadus_project)
end
it 'allows searching by parent namespace' do
......
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