Commit 888a3f69 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'fix-flaky-test' into 'master'

Use match_array in ee/spec/services/search_service_spec.rb

See merge request gitlab-org/gitlab!64236
parents 39f94c3d bbf31de4
......@@ -236,7 +236,7 @@ RSpec.describe SearchService do
project_ids = [accessible_project.id, accessible_project_2.id].join(',')
projects = described_class.new(user, group_id: group.id, project_ids: project_ids).projects
expect(projects).to match [accessible_project, accessible_project_2]
expect(projects).to match_array [accessible_project, accessible_project_2]
end
it 'returns the projects for guests' do
......@@ -245,14 +245,14 @@ RSpec.describe SearchService do
project_ids = [accessible_project.id, accessible_project_2.id, search_project.id].join(',')
projects = described_class.new(user, group_id: group.id, project_ids: project_ids).projects
expect(projects).to match [accessible_project, accessible_project_2, search_project]
expect(projects).to match_array [accessible_project, accessible_project_2, search_project]
end
it 'handles spaces in the param' do
project_ids = [accessible_project.id, accessible_project_2.id].join(', ')
projects = described_class.new(user, group_id: group.id, project_ids: project_ids).projects
expect(projects).to match [accessible_project, accessible_project_2]
expect(projects).to match_array [accessible_project, accessible_project_2]
end
it 'returns nil if projects param is not a String' do
......@@ -268,7 +268,7 @@ RSpec.describe SearchService do
project_ids = [accessible_project.id, inaccessible_project.id].join(',')
projects = described_class.new(user, group_id: group.id, project_ids: project_ids).projects
expect(projects).to match [accessible_project]
expect(projects).to match_array [accessible_project]
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