Merge branch 'enable-rspec-be_eql-cop' into 'master'
Enable the RSpec/BeEql cop See merge request !9476
This commit is contained in:
commit
509ff2ab17
4 changed files with 8 additions and 8 deletions
|
@ -938,7 +938,7 @@ RSpec/AnyInstance:
|
||||||
|
|
||||||
# Check for expectations where `be(...)` can replace `eql(...)`.
|
# Check for expectations where `be(...)` can replace `eql(...)`.
|
||||||
RSpec/BeEql:
|
RSpec/BeEql:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
# Check that the first argument to the top level describe is the tested class or
|
# Check that the first argument to the top level describe is the tested class or
|
||||||
# module.
|
# module.
|
||||||
|
|
|
@ -95,10 +95,10 @@ describe Gitlab::LDAP::User, lib: true do
|
||||||
|
|
||||||
it 'maintains an identity per provider' do
|
it 'maintains an identity per provider' do
|
||||||
existing_user = create(:omniauth_user, email: 'john@example.com', provider: 'twitter')
|
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
|
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 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
|
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).to be_valid
|
||||||
expect(gl_user.username).to eql uid
|
expect(gl_user.username).to eql uid
|
||||||
expect(gl_user.email).to eql 'johndoe@example.com'
|
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 } }
|
identities_as_hash = gl_user.identities.map { |id| { provider: id.provider, extern_uid: id.extern_uid } }
|
||||||
expect(identities_as_hash).to match_array(
|
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).to be_valid
|
||||||
expect(gl_user.username).to eql 'john'
|
expect(gl_user.username).to eql 'john'
|
||||||
expect(gl_user.email).to eql 'john@example.com'
|
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 } }
|
identities_as_hash = gl_user.identities.map { |id| { provider: id.provider, extern_uid: id.extern_uid } }
|
||||||
expect(identities_as_hash).to match_array(
|
expect(identities_as_hash).to match_array(
|
||||||
[
|
[
|
||||||
|
|
|
@ -155,7 +155,7 @@ describe Gitlab::Saml::User, lib: true do
|
||||||
expect(gl_user).to be_valid
|
expect(gl_user).to be_valid
|
||||||
expect(gl_user.username).to eql uid
|
expect(gl_user.username).to eql uid
|
||||||
expect(gl_user.email).to eql 'john@mail.com'
|
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 } }
|
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' },
|
expect(identities_as_hash).to match_array([{ provider: 'ldapmain', extern_uid: 'uid=user1,ou=People,dc=example' },
|
||||||
{ provider: 'saml', extern_uid: uid }])
|
{ provider: 'saml', extern_uid: uid }])
|
||||||
|
@ -177,7 +177,7 @@ describe Gitlab::Saml::User, lib: true do
|
||||||
expect(gl_user).to be_valid
|
expect(gl_user).to be_valid
|
||||||
expect(gl_user.username).to eql 'john'
|
expect(gl_user.username).to eql 'john'
|
||||||
expect(gl_user.email).to eql 'john@mail.com'
|
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 } }
|
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' },
|
expect(identities_as_hash).to match_array([{ provider: 'ldapmain', extern_uid: 'uid=user1,ou=People,dc=example' },
|
||||||
{ provider: 'saml', extern_uid: uid }])
|
{ provider: 'saml', extern_uid: uid }])
|
||||||
|
@ -202,7 +202,7 @@ describe Gitlab::Saml::User, lib: true do
|
||||||
local_gl_user = local_saml_user.gl_user
|
local_gl_user = local_saml_user.gl_user
|
||||||
|
|
||||||
expect(local_gl_user).to be_valid
|
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 } }
|
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' },
|
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' }])
|
{ provider: 'saml', extern_uid: 'uid=user1,ou=People,dc=example' }])
|
||||||
|
|
Loading…
Reference in a new issue