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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
78ec4e8f
Commit
78ec4e8f
authored
Feb 24, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'enable-rspec-be_eql-cop-ee' into 'master'
Enable the RSpec/BeEql cop See merge request !1295
parents
691d2be2
a9585385
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
13 deletions
+13
-13
.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
spec/services/application_settings/update_service_spec.rb
spec/services/application_settings/update_service_spec.rb
+2
-2
spec/workers/admin_emails_worker_spec.rb
spec/workers/admin_emails_worker_spec.rb
+3
-3
No files found.
.rubocop.yml
View file @
78ec4e8f
...
...
@@ -938,7 +938,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 @
78ec4e8f
...
...
@@ -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 @
78ec4e8f
...
...
@@ -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
(
[
...
...
spec/lib/gitlab/saml/user_spec.rb
View file @
78ec4e8f
...
...
@@ -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'
}])
...
...
spec/services/application_settings/update_service_spec.rb
View file @
78ec4e8f
...
...
@@ -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
...
...
spec/workers/admin_emails_worker_spec.rb
View file @
78ec4e8f
...
...
@@ -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
...
...
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