diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-14 06:09:53 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-14 06:09:53 +0300 |
commit | 8f30cb223b5e15af8b21ff313e81f70d46c5a42a (patch) | |
tree | 6881d3077808ec9900011fb51c3df203591d5c2b /spec | |
parent | e73d5c696a5465f8ba28bdd5582e766f0fa42e7c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/graphql/mutations/design_management/upload_spec.rb | 2 | ||||
-rw-r--r-- | spec/graphql/resolvers/boards_resolver_spec.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/tracking/standard_context_spec.rb | 6 | ||||
-rw-r--r-- | spec/lib/gitlab_spec.rb | 19 | ||||
-rw-r--r-- | spec/mailers/emails/profile_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/concerns/awardable_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/snippet_spec.rb | 2 | ||||
-rw-r--r-- | spec/support/shared_examples/requests/api/resource_label_events_api_shared_examples.rb | 2 |
8 files changed, 21 insertions, 20 deletions
diff --git a/spec/graphql/mutations/design_management/upload_spec.rb b/spec/graphql/mutations/design_management/upload_spec.rb index ada88b7652c..1e585e55be4 100644 --- a/spec/graphql/mutations/design_management/upload_spec.rb +++ b/spec/graphql/mutations/design_management/upload_spec.rb @@ -105,7 +105,7 @@ RSpec.describe Mutations::DesignManagement::Upload do context "with a valid design" do it "returns the updated designs" do - expect(resolve[:errors]).to eq [] + expect(resolve[:errors]).to be_empty expect(resolve[:designs].map(&:filename)).to contain_exactly("dk.png") end end diff --git a/spec/graphql/resolvers/boards_resolver_spec.rb b/spec/graphql/resolvers/boards_resolver_spec.rb index 221e905f441..07d0902d3ba 100644 --- a/spec/graphql/resolvers/boards_resolver_spec.rb +++ b/spec/graphql/resolvers/boards_resolver_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Resolvers::BoardsResolver do shared_examples_for 'group and project boards resolver' do it 'does not create a default board' do - expect(resolve_boards).to eq [] + expect(resolve_boards).to be_empty end it 'calls Boards::BoardsFinder' do diff --git a/spec/lib/gitlab/tracking/standard_context_spec.rb b/spec/lib/gitlab/tracking/standard_context_spec.rb index 289818266bd..a0fb6a270a5 100644 --- a/spec/lib/gitlab/tracking/standard_context_spec.rb +++ b/spec/lib/gitlab/tracking/standard_context_spec.rb @@ -22,7 +22,7 @@ RSpec.describe Gitlab::Tracking::StandardContext do context 'staging' do before do - stub_config_setting(url: 'https://staging.gitlab.com') + stub_config_setting(url: Gitlab::Saas.staging_com_url) end include_examples 'contains environment', 'staging' @@ -30,7 +30,7 @@ RSpec.describe Gitlab::Tracking::StandardContext do context 'production' do before do - stub_config_setting(url: 'https://gitlab.com') + stub_config_setting(url: Gitlab::Saas.com_url) end include_examples 'contains environment', 'production' @@ -38,7 +38,7 @@ RSpec.describe Gitlab::Tracking::StandardContext do context 'org' do before do - stub_config_setting(url: 'https://dev.gitlab.org') + stub_config_setting(url: Gitlab::Saas.dev_url) end include_examples 'contains environment', 'org' diff --git a/spec/lib/gitlab_spec.rb b/spec/lib/gitlab_spec.rb index 4df00eaa439..869eaf26772 100644 --- a/spec/lib/gitlab_spec.rb +++ b/spec/lib/gitlab_spec.rb @@ -70,20 +70,21 @@ RSpec.describe Gitlab do end describe '.com?' do - it 'is true when on GitLab.com' do - stub_config_setting(url: 'https://gitlab.com') + it "is true when on #{Gitlab::Saas.com_url}" do + stub_config_setting(url: Gitlab::Saas.com_url) expect(described_class.com?).to eq true end - it 'is true when on staging' do - stub_config_setting(url: 'https://staging.gitlab.com') + it "is true when on #{Gitlab::Saas.staging_com_url}" do + stub_config_setting(url: Gitlab::Saas.staging_com_url) expect(described_class.com?).to eq true end it 'is true when on other gitlab subdomain' do - stub_config_setting(url: 'https://example.gitlab.com') + url_with_subdomain = Gitlab::Saas.com_url.gsub('https://', 'https://example.') + stub_config_setting(url: url_with_subdomain) expect(described_class.com?).to eq true end @@ -118,14 +119,14 @@ RSpec.describe Gitlab do describe '.staging?' do subject { described_class.staging? } - it 'is false when on GitLab.com' do - stub_config_setting(url: 'https://gitlab.com') + it "is false when on #{Gitlab::Saas.com_url}" do + stub_config_setting(url: Gitlab::Saas.com_url) expect(subject).to eq false end - it 'is true when on staging' do - stub_config_setting(url: 'https://staging.gitlab.com') + it "is true when on #{Gitlab::Saas.staging_com_url}" do + stub_config_setting(url: Gitlab::Saas.staging_com_url) expect(subject).to eq true end diff --git a/spec/mailers/emails/profile_spec.rb b/spec/mailers/emails/profile_spec.rb index 9b5633a9f90..365ca892bb1 100644 --- a/spec/mailers/emails/profile_spec.rb +++ b/spec/mailers/emails/profile_spec.rb @@ -264,7 +264,7 @@ RSpec.describe Emails::Profile do include_examples 'valid use case' it_behaves_like 'has the correct subject', /Your SSH key has expired/ - it_behaves_like 'has the correct body text', /Your SSH keys with the following fingerprints have expired/ + it_behaves_like 'has the correct body text', /SSH keys with the following fingerprints have expired/ end context 'when invalid' do @@ -291,7 +291,7 @@ RSpec.describe Emails::Profile do include_examples 'valid use case' it_behaves_like 'has the correct subject', /Your SSH key is expiring soon/ - it_behaves_like 'has the correct body text', /Your SSH keys with the following fingerprints are scheduled to expire soon/ + it_behaves_like 'has the correct body text', /SSH keys with the following fingerprints are scheduled to expire soon/ end context 'when invalid' do diff --git a/spec/models/concerns/awardable_spec.rb b/spec/models/concerns/awardable_spec.rb index b5b3772ecb6..b80b6ec95e2 100644 --- a/spec/models/concerns/awardable_spec.rb +++ b/spec/models/concerns/awardable_spec.rb @@ -108,7 +108,7 @@ RSpec.describe Awardable do it "doesn't include unused thumbs buttons when disabled in project" do issue_without_downvote.project.show_default_award_emojis = false - expect(issue_without_downvote.grouped_awards.keys.sort).to eq [] + expect(issue_without_downvote.grouped_awards.keys.sort).to be_empty end it "includes unused thumbs buttons when enabled in project" do @@ -118,7 +118,7 @@ RSpec.describe Awardable do end it "doesn't include unused thumbs buttons in summary" do - expect(issue_without_downvote.grouped_awards(with_thumbs: false).keys).to eq [] + expect(issue_without_downvote.grouped_awards(with_thumbs: false).keys).to be_empty end it "includes used thumbs buttons when disabled in project" do diff --git a/spec/models/snippet_spec.rb b/spec/models/snippet_spec.rb index 41991821922..06e9899c0bd 100644 --- a/spec/models/snippet_spec.rb +++ b/spec/models/snippet_spec.rb @@ -750,7 +750,7 @@ RSpec.describe Snippet do end it 'returns an empty array' do - expect(subject).to eq [] + expect(subject).to be_empty end end end diff --git a/spec/support/shared_examples/requests/api/resource_label_events_api_shared_examples.rb b/spec/support/shared_examples/requests/api/resource_label_events_api_shared_examples.rb index 675b6c5cef6..2ac78131e08 100644 --- a/spec/support/shared_examples/requests/api/resource_label_events_api_shared_examples.rb +++ b/spec/support/shared_examples/requests/api/resource_label_events_api_shared_examples.rb @@ -48,7 +48,7 @@ RSpec.shared_examples 'resource_label_events API' do |parent_type, eventable_typ get api("/#{parent_type}/#{parent.id}/#{eventable_type}/#{eventable[id_name]}/resource_label_events", user) expect(json_response).to be_an Array - expect(json_response).to eq [] + expect(json_response).to be_empty end end end |