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
8faa20a8
Commit
8faa20a8
authored
Jun 29, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable RSpec/BeforeAfterAll and enable RSpec/ImplicitExpect cops
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
997355a0
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
29 additions
and
29 deletions
+29
-29
.rubocop.yml
.rubocop.yml
+10
-0
.rubocop_todo.yml
.rubocop_todo.yml
+0
-10
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+3
-3
spec/models/approval_spec.rb
spec/models/approval_spec.rb
+1
-1
spec/models/approver_group_spec.rb
spec/models/approver_group_spec.rb
+1
-1
spec/models/project_group_link_spec.rb
spec/models/project_group_link_spec.rb
+6
-6
spec/models/project_services/external_wiki_service_spec.rb
spec/models/project_services/external_wiki_service_spec.rb
+2
-2
spec/models/project_spec.rb
spec/models/project_spec.rb
+3
-3
spec/models/push_rule_spec.rb
spec/models/push_rule_spec.rb
+3
-3
No files found.
.rubocop.yml
View file @
8faa20a8
...
@@ -967,6 +967,10 @@ RSpec/AnyInstance:
...
@@ -967,6 +967,10 @@ RSpec/AnyInstance:
RSpec/BeEql
:
RSpec/BeEql
:
Enabled
:
true
Enabled
:
true
# We don't enforce this as we use this technique in a few places.
RSpec/BeforeAfterAll
:
Enabled
:
false
# 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.
RSpec/DescribeClass
:
RSpec/DescribeClass
:
...
@@ -1029,6 +1033,12 @@ RSpec/FilePath:
...
@@ -1029,6 +1033,12 @@ RSpec/FilePath:
RSpec/Focus
:
RSpec/Focus
:
Enabled
:
true
Enabled
:
true
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: is_expected, should
RSpec/ImplicitExpect
:
Enabled
:
true
EnforcedStyle
:
is_expected
# Checks for the usage of instance variables.
# Checks for the usage of instance variables.
RSpec/InstanceVariable
:
RSpec/InstanceVariable
:
Enabled
:
false
Enabled
:
false
...
...
.rubocop_todo.yml
View file @
8faa20a8
...
@@ -6,10 +6,6 @@
...
@@ -6,10 +6,6 @@
# Note that changes in the inspected code, or installation of new
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# versions of RuboCop, may require this file to be generated again.
# Offense count: 54
RSpec/BeforeAfterAll
:
Enabled
:
false
# Offense count: 233
# Offense count: 233
RSpec/EmptyLineAfterFinalLet
:
RSpec/EmptyLineAfterFinalLet
:
Enabled
:
false
Enabled
:
false
...
@@ -24,12 +20,6 @@ RSpec/EmptyLineAfterSubject:
...
@@ -24,12 +20,6 @@ RSpec/EmptyLineAfterSubject:
RSpec/HookArgument
:
RSpec/HookArgument
:
Enabled
:
false
Enabled
:
false
# Offense count: 12
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: is_expected, should
RSpec/ImplicitExpect
:
Enabled
:
false
# Offense count: 11
# Offense count: 11
# Configuration parameters: EnforcedStyle, SupportedStyles.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: it_behaves_like, it_should_behave_like
# SupportedStyles: it_behaves_like, it_should_behave_like
...
...
spec/mailers/notify_spec.rb
View file @
8faa20a8
...
@@ -1357,16 +1357,16 @@ describe Notify do
...
@@ -1357,16 +1357,16 @@ describe Notify do
end
end
it
'is sent to recipient'
do
it
'is sent to recipient'
do
should
deliver_to
user
.
email
is_expected
.
to
deliver_to
user
.
email
end
end
it
'has the correct subject'
do
it
'has the correct subject'
do
should
have_subject
'Admin announcement'
is_expected
.
to
have_subject
'Admin announcement'
end
end
it
'includes unsubscribe link'
do
it
'includes unsubscribe link'
do
unsubscribe_link
=
"http://localhost/unsubscribes/
#{
Base64
.
urlsafe_encode64
(
user
.
email
)
}
"
unsubscribe_link
=
"http://localhost/unsubscribes/
#{
Base64
.
urlsafe_encode64
(
user
.
email
)
}
"
should
have_body_text
(
unsubscribe_link
)
is_expected
.
to
have_body_text
(
unsubscribe_link
)
end
end
end
end
...
...
spec/models/approval_spec.rb
View file @
8faa20a8
...
@@ -3,5 +3,5 @@ require 'spec_helper'
...
@@ -3,5 +3,5 @@ require 'spec_helper'
describe
Approval
do
describe
Approval
do
subject
{
create
(
:approval
)
}
subject
{
create
(
:approval
)
}
it
{
should
be_valid
}
it
{
is_expected
.
to
be_valid
}
end
end
spec/models/approver_group_spec.rb
View file @
8faa20a8
...
@@ -3,5 +3,5 @@ require 'spec_helper'
...
@@ -3,5 +3,5 @@ require 'spec_helper'
describe
ApproverGroup
do
describe
ApproverGroup
do
subject
{
create
(
:approver_group
)
}
subject
{
create
(
:approver_group
)
}
it
{
should
be_valid
}
it
{
is_expected
.
to
be_valid
}
end
end
spec/models/project_group_link_spec.rb
View file @
8faa20a8
...
@@ -2,8 +2,8 @@ require 'spec_helper'
...
@@ -2,8 +2,8 @@ require 'spec_helper'
describe
ProjectGroupLink
do
describe
ProjectGroupLink
do
describe
"Associations"
do
describe
"Associations"
do
it
{
should
belong_to
(
:group
)
}
it
{
is_expected
.
to
belong_to
(
:group
)
}
it
{
should
belong_to
(
:project
)
}
it
{
is_expected
.
to
belong_to
(
:project
)
}
end
end
describe
"Validation"
do
describe
"Validation"
do
...
@@ -12,10 +12,10 @@ describe ProjectGroupLink do
...
@@ -12,10 +12,10 @@ describe ProjectGroupLink do
let
(
:project
)
{
create
(
:project
,
group:
group
)
}
let
(
:project
)
{
create
(
:project
,
group:
group
)
}
let!
(
:project_group_link
)
{
create
(
:project_group_link
,
project:
project
)
}
let!
(
:project_group_link
)
{
create
(
:project_group_link
,
project:
project
)
}
it
{
should
validate_presence_of
(
:project_id
)
}
it
{
is_expected
.
to
validate_presence_of
(
:project_id
)
}
it
{
should
validate_uniqueness_of
(
:group_id
).
scoped_to
(
:project_id
).
with_message
(
/already shared/
)
}
it
{
is_expected
.
to
validate_uniqueness_of
(
:group_id
).
scoped_to
(
:project_id
).
with_message
(
/already shared/
)
}
it
{
should
validate_presence_of
(
:group
)
}
it
{
is_expected
.
to
validate_presence_of
(
:group
)
}
it
{
should
validate_presence_of
(
:group_access
)
}
it
{
is_expected
.
to
validate_presence_of
(
:group_access
)
}
it
"doesn't allow a project to be shared with the group it is in"
do
it
"doesn't allow a project to be shared with the group it is in"
do
project_group_link
.
group
=
group
project_group_link
.
group
=
group
...
...
spec/models/project_services/external_wiki_service_spec.rb
View file @
8faa20a8
...
@@ -3,8 +3,8 @@ require 'spec_helper'
...
@@ -3,8 +3,8 @@ require 'spec_helper'
describe
ExternalWikiService
,
models:
true
do
describe
ExternalWikiService
,
models:
true
do
include
ExternalWikiHelper
include
ExternalWikiHelper
describe
"Associations"
do
describe
"Associations"
do
it
{
should
belong_to
:project
}
it
{
is_expected
.
to
belong_to
:project
}
it
{
should
have_one
:service_hook
}
it
{
is_expected
.
to
have_one
:service_hook
}
end
end
describe
'Validations'
do
describe
'Validations'
do
...
...
spec/models/project_spec.rb
View file @
8faa20a8
...
@@ -1006,7 +1006,7 @@ describe Project, models: true do
...
@@ -1006,7 +1006,7 @@ describe Project, models: true do
allow
(
Gitlab
::
Geo
).
to
receive_message_chain
(
:primary_node
,
:url
)
{
geo_url
}
allow
(
Gitlab
::
Geo
).
to
receive_message_chain
(
:primary_node
,
:url
)
{
geo_url
}
end
end
it
{
should
eq
"
#{
geo_url
}#{
avatar_path
}
"
}
it
{
is_expected
.
to
eq
"
#{
geo_url
}#{
avatar_path
}
"
}
end
end
end
end
...
@@ -1017,13 +1017,13 @@ describe Project, models: true do
...
@@ -1017,13 +1017,13 @@ describe Project, models: true do
let
(
:avatar_path
)
{
"/
#{
project
.
full_path
}
/avatar"
}
let
(
:avatar_path
)
{
"/
#{
project
.
full_path
}
/avatar"
}
it
{
should
eq
"http://
#{
Gitlab
.
config
.
gitlab
.
host
}#{
avatar_path
}
"
}
it
{
is_expected
.
to
eq
"http://
#{
Gitlab
.
config
.
gitlab
.
host
}#{
avatar_path
}
"
}
end
end
context
'when git repo is empty'
do
context
'when git repo is empty'
do
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:project
)
{
create
(
:empty_project
)
}
it
{
should
eq
nil
}
it
{
is_expected
.
to
eq
nil
}
end
end
end
end
...
...
spec/models/push_rule_spec.rb
View file @
8faa20a8
...
@@ -2,11 +2,11 @@ require 'spec_helper'
...
@@ -2,11 +2,11 @@ require 'spec_helper'
describe
PushRule
do
describe
PushRule
do
describe
"Associations"
do
describe
"Associations"
do
it
{
should
belong_to
(
:project
)
}
it
{
is_expected
.
to
belong_to
(
:project
)
}
end
end
describe
"Validation"
do
describe
"Validation"
do
it
{
should
validate_presence_of
(
:project
)
}
it
{
is_expected
.
to
validate_presence_of
(
:project
)
}
it
{
should
validate_numericality_of
(
:max_file_size
).
is_greater_than_or_equal_to
(
0
).
only_integer
}
it
{
is_expected
.
to
validate_numericality_of
(
:max_file_size
).
is_greater_than_or_equal_to
(
0
).
only_integer
}
end
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