diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-31 18:07:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-31 18:07:20 +0300 |
commit | fab00cd7efb84b369dfb45cabb797f7feace4b66 (patch) | |
tree | fd3eb7509bf3947ddd818214350a06d16822c78a /spec/services | |
parent | 07f6ded1cb698550284e5f348de8f1b884e715ae (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/jira_connect_installations/update_service_spec.rb | 12 | ||||
-rw-r--r-- | spec/services/search/global_service_spec.rb | 21 |
2 files changed, 15 insertions, 18 deletions
diff --git a/spec/services/jira_connect_installations/update_service_spec.rb b/spec/services/jira_connect_installations/update_service_spec.rb index 15f3b485b20..cb45865f6fe 100644 --- a/spec/services/jira_connect_installations/update_service_spec.rb +++ b/spec/services/jira_connect_installations/update_service_spec.rb @@ -137,11 +137,7 @@ RSpec.describe JiraConnectInstallations::UpdateService, feature_category: :integ it 'returns an error message' do expect(execute_service[:status]).to eq(:error) - expect(execute_service[:message]).to eq( - { - instance_url: ["Could not be installed on the instance. Error response code 422"] - } - ) + expect(execute_service[:message]).to eq("Could not be installed on the instance. Error response code 422") end context 'and the installation had a previous instance_url' do @@ -175,11 +171,7 @@ RSpec.describe JiraConnectInstallations::UpdateService, feature_category: :integ it 'returns an error message' do expect(execute_service[:status]).to eq(:error) - expect(execute_service[:message]).to eq( - { - instance_url: ["Could not be installed on the instance. Network error"] - } - ) + expect(execute_service[:message]).to eq("Could not be installed on the instance. Network error") end end end diff --git a/spec/services/search/global_service_spec.rb b/spec/services/search/global_service_spec.rb index 6250d32574f..f77d81851e3 100644 --- a/spec/services/search/global_service_spec.rb +++ b/spec/services/search/global_service_spec.rb @@ -3,13 +3,14 @@ require 'spec_helper' RSpec.describe Search::GlobalService, feature_category: :global_search do - let(:user) { create(:user) } - let(:internal_user) { create(:user) } + let_it_be(:user) { create(:user) } + let_it_be(:internal_user) { create(:user) } - let!(:found_project) { create(:project, :private, name: 'searchable_project') } - let!(:unfound_project) { create(:project, :private, name: 'unfound_project') } - let!(:internal_project) { create(:project, :internal, name: 'searchable_internal_project') } - let!(:public_project) { create(:project, :public, name: 'searchable_public_project') } + let_it_be(:found_project) { create(:project, :private, name: 'searchable_project') } + let_it_be(:unfound_project) { create(:project, :private, name: 'unfound_project') } + let_it_be(:internal_project) { create(:project, :internal, name: 'searchable_internal_project') } + let_it_be(:public_project) { create(:project, :public, name: 'searchable_public_project') } + let_it_be(:archived_project) { create(:project, :public, archived: true, name: 'archived_project') } before do found_project.add_maintainer(user) @@ -44,12 +45,16 @@ RSpec.describe Search::GlobalService, feature_category: :global_search do end it 'does not return archived projects' do - archived_project = create(:project, :public, archived: true, name: 'archived_project') - results = described_class.new(user, search: "archived").execute expect(results.objects('projects')).not_to include(archived_project) end + + it 'returns archived projects if the include_archived option is passed' do + results = described_class.new(user, { include_archived: true, search: "archived" }).execute + + expect(results.objects('projects')).to include(archived_project) + end end end |