Commit 78ec4e8f authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'enable-rspec-be_eql-cop-ee' into 'master'

Enable the RSpec/BeEql cop

See merge request !1295
parents 691d2be2 a9585385
......@@ -938,7 +938,7 @@ RSpec/AnyInstance:
# Check for expectations where `be(...)` can replace `eql(...)`.
RSpec/BeEql:
Enabled: false
Enabled: true
# Check that the first argument to the top level describe is the tested class or
# module.
......
......@@ -95,10 +95,10 @@ describe Gitlab::LDAP::User, lib: true do
it 'maintains an identity per provider' do
existing_user = create(:omniauth_user, email: 'john@example.com', provider: 'twitter')
expect(existing_user.identities.count).to eql(1)
expect(existing_user.identities.count).to be(1)
ldap_user.save
expect(ldap_user.gl_user.identities.count).to eql(2)
expect(ldap_user.gl_user.identities.count).to be(2)
# Expect that find_by provider only returns a single instance of an identity and not an Enumerable
expect(ldap_user.gl_user.identities.find_by(provider: 'twitter')).to be_instance_of Identity
......
......@@ -148,7 +148,7 @@ describe Gitlab::OAuth::User, lib: true do
expect(gl_user).to be_valid
expect(gl_user.username).to eql uid
expect(gl_user.email).to eql 'johndoe@example.com'
expect(gl_user.identities.length).to eql 2
expect(gl_user.identities.length).to be 2
identities_as_hash = gl_user.identities.map { |id| { provider: id.provider, extern_uid: id.extern_uid } }
expect(identities_as_hash).to match_array(
[
......@@ -169,7 +169,7 @@ describe Gitlab::OAuth::User, lib: true do
expect(gl_user).to be_valid
expect(gl_user.username).to eql 'john'
expect(gl_user.email).to eql 'john@example.com'
expect(gl_user.identities.length).to eql 2
expect(gl_user.identities.length).to be 2
identities_as_hash = gl_user.identities.map { |id| { provider: id.provider, extern_uid: id.extern_uid } }
expect(identities_as_hash).to match_array(
[
......
......@@ -208,7 +208,7 @@ describe Gitlab::Saml::User, lib: true do
expect(gl_user).to be_valid
expect(gl_user.username).to eql uid
expect(gl_user.email).to eql 'john@mail.com'
expect(gl_user.identities.length).to eql 2
expect(gl_user.identities.length).to be 2
identities_as_hash = gl_user.identities.map { |id| { provider: id.provider, extern_uid: id.extern_uid } }
expect(identities_as_hash).to match_array([{ provider: 'ldapmain', extern_uid: 'uid=user1,ou=People,dc=example' },
{ provider: 'saml', extern_uid: uid }])
......@@ -230,7 +230,7 @@ describe Gitlab::Saml::User, lib: true do
expect(gl_user).to be_valid
expect(gl_user.username).to eql 'john'
expect(gl_user.email).to eql 'john@mail.com'
expect(gl_user.identities.length).to eql 2
expect(gl_user.identities.length).to be 2
identities_as_hash = gl_user.identities.map { |id| { provider: id.provider, extern_uid: id.extern_uid } }
expect(identities_as_hash).to match_array([{ provider: 'ldapmain', extern_uid: 'uid=user1,ou=People,dc=example' },
{ provider: 'saml', extern_uid: uid }])
......@@ -255,7 +255,7 @@ describe Gitlab::Saml::User, lib: true do
local_gl_user = local_saml_user.gl_user
expect(local_gl_user).to be_valid
expect(local_gl_user.identities.length).to eql 2
expect(local_gl_user.identities.length).to be 2
identities_as_hash = local_gl_user.identities.map { |id| { provider: id.provider, extern_uid: id.extern_uid } }
expect(identities_as_hash).to match_array([{ provider: 'ldapmain', extern_uid: 'uid=user1,ou=People,dc=example' },
{ provider: 'saml', extern_uid: 'uid=user1,ou=People,dc=example' }])
......
......@@ -20,7 +20,7 @@ describe ApplicationSettings::UpdateService, services: true do
let(:opts) { { repository_size_limit: '100' } }
it 'returns success params' do
expect(service.execute).to eql(true)
expect(service.execute).to be(true)
end
end
......@@ -28,7 +28,7 @@ describe ApplicationSettings::UpdateService, services: true do
let(:opts) { { repository_size_limit: '-100' } }
it 'returns error params' do
expect(service.execute).to eql(false)
expect(service.execute).to be(false)
end
end
......
......@@ -27,7 +27,7 @@ describe AdminEmailsWorker do
it "sends email to subscribed users" do
perform_enqueued_jobs do
AdminEmailsWorker.new.perform(recipient_id, 'subject', 'body')
expect(ActionMailer::Base.deliveries.count).to eql 2
expect(ActionMailer::Base.deliveries.count).to be 2
end
end
end
......@@ -38,7 +38,7 @@ describe AdminEmailsWorker do
it "sends email to subscribed users" do
perform_enqueued_jobs do
AdminEmailsWorker.new.perform(recipient_id, 'subject', 'body')
expect(ActionMailer::Base.deliveries.count).to eql 2
expect(ActionMailer::Base.deliveries.count).to be 2
end
end
end
......@@ -49,7 +49,7 @@ describe AdminEmailsWorker do
it "sends email to subscribed users" do
perform_enqueued_jobs do
AdminEmailsWorker.new.perform(recipient_id, 'subject', 'body')
expect(ActionMailer::Base.deliveries.count).to eql 4
expect(ActionMailer::Base.deliveries.count).to be 4
end
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