Commit f3cb47bc authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'it-behaves-cop' into 'master'

Fix RSpec/ItBehavesLike cop

See merge request gitlab-org/gitlab!41111
parents 52515a29 33a92272
......@@ -215,15 +215,6 @@ RSpec/ExpectChange:
RSpec/ExpectInHook:
Enabled: false
# Offense count: 9
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: it_behaves_like, it_should_behave_like
RSpec/ItBehavesLike:
Exclude:
- 'spec/lib/gitlab/git/commit_spec.rb'
- 'spec/services/notification_service_spec.rb'
# Offense count: 68
# Cop supports --auto-correct.
RSpec/LetBeforeExamples:
......
---
title: Fix RSpec/ItBehavesLike cop
merge_request: 41111
author: Rajendra Kadam
type: fixed
......@@ -192,7 +192,7 @@ RSpec.describe Gitlab::Git::Commit, :seed_helper do
end
describe '.find with Gitaly enabled' do
it_should_behave_like '.find'
it_behaves_like '.find'
end
describe '.find with Rugged enabled', :enable_rugged do
......@@ -204,7 +204,7 @@ RSpec.describe Gitlab::Git::Commit, :seed_helper do
described_class.find(repository, SeedRepo::Commit::ID)
end
it_should_behave_like '.find'
it_behaves_like '.find'
end
describe '.last_for_path' do
......@@ -474,7 +474,7 @@ RSpec.describe Gitlab::Git::Commit, :seed_helper do
end
describe '.batch_by_oid with Gitaly enabled' do
it_should_behave_like '.batch_by_oid'
it_behaves_like '.batch_by_oid'
context 'when oids is empty' do
it 'makes no Gitaly request' do
......@@ -486,7 +486,7 @@ RSpec.describe Gitlab::Git::Commit, :seed_helper do
end
describe '.batch_by_oid with Rugged enabled', :enable_rugged do
it_should_behave_like '.batch_by_oid'
it_behaves_like '.batch_by_oid'
it 'calls out to the Rugged implementation' do
allow_next_instance_of(Rugged) do |instance|
......
......@@ -151,9 +151,9 @@ RSpec.describe NotificationService, :mailer do
end
shared_examples_for 'participating notifications' do
it_should_behave_like 'participating by note notification'
it_should_behave_like 'participating by author notification'
it_should_behave_like 'participating by assignee notification'
it_behaves_like 'participating by note notification'
it_behaves_like 'participating by author notification'
it_behaves_like 'participating by assignee notification'
end
describe '#async' do
......@@ -1682,13 +1682,13 @@ RSpec.describe NotificationService, :mailer do
end
context 'participating' do
it_should_behave_like 'participating by assignee notification' do
it_behaves_like 'participating by assignee notification' do
let(:participant) { create(:user, username: 'user-participant')}
let(:issuable) { merge_request }
let(:notification_trigger) { notification.new_merge_request(merge_request, @u_disabled) }
end
it_should_behave_like 'participating by note notification' do
it_behaves_like 'participating by note notification' do
let(:participant) { create(:user, username: 'user-participant')}
let(:issuable) { merge_request }
let(:notification_trigger) { notification.new_merge_request(merge_request, @u_disabled) }
......
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