Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
8b2ea599
Commit
8b2ea599
authored
Feb 23, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable the RSpec/BeEql cop
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
759f9c74
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
.rubocop.yml
.rubocop.yml
+1
-1
spec/lib/gitlab/ldap/user_spec.rb
spec/lib/gitlab/ldap/user_spec.rb
+2
-2
spec/lib/gitlab/o_auth/user_spec.rb
spec/lib/gitlab/o_auth/user_spec.rb
+2
-2
spec/lib/gitlab/saml/user_spec.rb
spec/lib/gitlab/saml/user_spec.rb
+3
-3
No files found.
.rubocop.yml
View file @
8b2ea599
...
...
@@ -784,7 +784,7 @@ RSpec/AnyInstance:
# Check for expectations where `be(...)` can replace `eql(...)`.
RSpec/BeEql
:
Enabled
:
fals
e
Enabled
:
tru
e
# Check that the first argument to the top level describe is the tested class or
# module.
...
...
spec/lib/gitlab/ldap/user_spec.rb
View file @
8b2ea599
...
...
@@ -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
...
...
spec/lib/gitlab/o_auth/user_spec.rb
View file @
8b2ea599
...
...
@@ -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
(
[
{
provider:
'ldapmain'
,
extern_uid:
'uid=user1,ou=People,dc=example'
},
...
...
@@ -167,7 +167,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
(
[
{
provider:
'ldapmain'
,
extern_uid:
'uid=user1,ou=People,dc=example'
},
...
...
spec/lib/gitlab/saml/user_spec.rb
View file @
8b2ea599
...
...
@@ -155,7 +155,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
}
...
...
@@ -178,7 +178,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
}
...
...
@@ -204,7 +204,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'
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment