BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
75739e54
Commit
75739e54
authored
May 23, 2016
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable RSpec/NotToNot cop and auto-correct offenses
Also removes the note from the development/testing.md guide
parent
16ca3ee6
Show whitespace changes
Inline
Side-by-side
Showing
65 changed files
with
117 additions
and
117 deletions
+117
-117
.rubocop.yml
.rubocop.yml
+1
-1
testing.md
doc/development/testing.md
+1
-1
users.rb
features/steps/admin/users.rb
+1
-1
todos.rb
features/steps/dashboard/todos.rb
+1
-1
commits.rb
features/steps/project/commits/commits.rb
+1
-1
award_emoji.rb
features/steps/project/issues/award_emoji.rb
+2
-2
issues.rb
features/steps/project/issues/issues.rb
+2
-2
merge_requests.rb
features/steps/project/merge_requests.rb
+2
-2
note.rb
features/steps/shared/note.rb
+1
-1
projects_controller_spec.rb
spec/controllers/admin/projects_controller_spec.rb
+1
-1
compare_controller_spec.rb
spec/controllers/projects/compare_controller_spec.rb
+2
-2
group_links_controller_spec.rb
spec/controllers/projects/group_links_controller_spec.rb
+1
-1
issues_controller_spec.rb
spec/controllers/projects/issues_controller_spec.rb
+1
-1
project_members_controller_spec.rb
spec/controllers/projects/project_members_controller_spec.rb
+1
-1
registrations_controller_spec.rb
spec/controllers/registrations_controller_spec.rb
+1
-1
sessions_controller_spec.rb
spec/controllers/sessions_controller_spec.rb
+3
-3
factories_spec.rb
spec/factories_spec.rb
+1
-1
admin_runners_spec.rb
spec/features/admin/admin_runners_spec.rb
+1
-1
admin_users_spec.rb
spec/features/admin/admin_users_spec.rb
+1
-1
builds_spec.rb
spec/features/builds_spec.rb
+2
-2
commits_spec.rb
spec/features/commits_spec.rb
+5
-5
update_issues_spec.rb
spec/features/issues/update_issues_spec.rb
+1
-1
pipelines_spec.rb
spec/features/pipelines_spec.rb
+7
-7
runners_spec.rb
spec/features/runners_spec.rb
+2
-2
variables_spec.rb
spec/features/variables_spec.rb
+1
-1
auth_helper_spec.rb
spec/helpers/auth_helper_spec.rb
+1
-1
merge_requests_helper_spec.rb
spec/helpers/merge_requests_helper_spec.rb
+1
-1
award_emoji_spec.rb
spec/lib/award_emoji_spec.rb
+1
-1
gitlab_ci_yaml_processor_spec.rb
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+3
-3
registry_spec.rb
spec/lib/container_registry/registry_spec.rb
+1
-1
repository_spec.rb
spec/lib/container_registry/repository_spec.rb
+3
-3
tag_spec.rb
spec/lib/container_registry/tag_spec.rb
+2
-2
client_spec.rb
spec/lib/gitlab/bitbucket_import/client_spec.rb
+1
-1
entry_spec.rb
spec/lib/gitlab/ci/build/artifacts/metadata/entry_spec.rb
+1
-1
reference_rewriter_spec.rb
spec/lib/gitlab/gfm/reference_rewriter_spec.rb
+2
-2
uploads_rewriter_spec.rb
spec/lib/gitlab/gfm/uploads_rewriter_spec.rb
+4
-4
lfs_router_spec.rb
spec/lib/gitlab/lfs/lfs_router_spec.rb
+2
-2
instrumentation_spec.rb
spec/lib/gitlab/metrics/instrumentation_spec.rb
+4
-4
sampler_spec.rb
spec/lib/gitlab/metrics/sampler_spec.rb
+1
-1
active_record_spec.rb
spec/lib/gitlab/metrics/subscribers/active_record_spec.rb
+1
-1
collection_spec.rb
spec/lib/gitlab/sherlock/collection_spec.rb
+3
-3
query_spec.rb
spec/lib/gitlab/sherlock/query_spec.rb
+1
-1
transaction_spec.rb
spec/lib/gitlab/sherlock/transaction_spec.rb
+2
-2
rsa_token_spec.rb
spec/lib/json_web_token/rsa_token_spec.rb
+1
-1
notify.rb
spec/mailers/shared/notify.rb
+2
-2
build_spec.rb
spec/models/build_spec.rb
+4
-4
commit_spec.rb
spec/models/ci/commit_spec.rb
+1
-1
runner_spec.rb
spec/models/ci/runner_spec.rb
+1
-1
issuable_spec.rb
spec/models/concerns/issuable_spec.rb
+1
-1
token_authenticatable_spec.rb
spec/models/concerns/token_authenticatable_spec.rb
+2
-2
generic_commit_status_spec.rb
spec/models/generic_commit_status_spec.rb
+2
-2
issue_spec.rb
spec/models/issue_spec.rb
+1
-1
hipchat_service_spec.rb
spec/models/project_services/hipchat_service_spec.rb
+1
-1
project_spec.rb
spec/models/project_spec.rb
+2
-2
repository_spec.rb
spec/models/repository_spec.rb
+5
-5
project_members_spec.rb
spec/requests/api/project_members_spec.rb
+1
-1
system_hooks_spec.rb
spec/requests/api/system_hooks_spec.rb
+1
-1
builds_spec.rb
spec/requests/ci/api/builds_spec.rb
+2
-2
container_registry_authentication_service_spec.rb
...es/auth/container_registry_authentication_service_spec.rb
+2
-2
create_commit_builds_service_spec.rb
spec/services/create_commit_builds_service_spec.rb
+1
-1
create_service_spec.rb
spec/services/groups/create_service_spec.rb
+1
-1
create_service_spec.rb
spec/services/issues/create_service_spec.rb
+2
-2
move_service_spec.rb
spec/services/issues/move_service_spec.rb
+3
-3
merge_when_build_succeeds_service_spec.rb
.../merge_requests/merge_when_build_succeeds_service_spec.rb
+3
-3
post_receive_spec.rb
spec/workers/post_receive_spec.rb
+1
-1
No files found.
.rubocop.yml
View file @
75739e54
...
@@ -1130,7 +1130,7 @@ RSpec/MultipleDescribes:
...
@@ -1130,7 +1130,7 @@ RSpec/MultipleDescribes:
# Enforces the usage of the same method on all negative message expectations.
# Enforces the usage of the same method on all negative message expectations.
RSpec/NotToNot
:
RSpec/NotToNot
:
EnforcedStyle
:
not_to
EnforcedStyle
:
not_to
Enabled
:
fals
e
Enabled
:
tru
e
# Prefer using verifying doubles over normal doubles.
# Prefer using verifying doubles over normal doubles.
RSpec/VerifiedDoubles
:
RSpec/VerifiedDoubles
:
...
...
doc/development/testing.md
View file @
75739e54
...
@@ -65,7 +65,7 @@ the command line via `bundle exec teaspoon`, or via a web browser at
...
@@ -65,7 +65,7 @@ the command line via `bundle exec teaspoon`, or via a web browser at
-
Use
`context`
to test branching logic.
-
Use
`context`
to test branching logic.
-
Don't
`describe`
symbols (see
[
Gotchas
](
gotchas.md#dont-describe-symbols
)
).
-
Don't
`describe`
symbols (see
[
Gotchas
](
gotchas.md#dont-describe-symbols
)
).
-
Don't supply the
`:each`
argument to hooks since it's the default.
-
Don't supply the
`:each`
argument to hooks since it's the default.
-
Prefer
`not_to`
to
`to_not`
.
-
Prefer
`not_to`
to
`to_not`
(_this is enforced by Rubocop_)
.
-
Try to match the ordering of tests to the ordering within the class.
-
Try to match the ordering of tests to the ordering within the class.
-
Try to follow the
[
Four-Phase Test
][
four-phase-test
]
pattern, using newlines
-
Try to follow the
[
Four-Phase Test
][
four-phase-test
]
pattern, using newlines
to separate phases.
to separate phases.
...
...
features/steps/admin/users.rb
View file @
75739e54
...
@@ -158,7 +158,7 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
...
@@ -158,7 +158,7 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
step
'I should not see twitter details'
do
step
'I should not see twitter details'
do
expect
(
page
).
to
have_content
'Pete'
expect
(
page
).
to
have_content
'Pete'
expect
(
page
).
to_not
have_content
'twitter'
expect
(
page
).
not_to
have_content
'twitter'
end
end
step
'click on ssh keys tab'
do
step
'click on ssh keys tab'
do
...
...
features/steps/dashboard/todos.rb
View file @
75739e54
...
@@ -106,7 +106,7 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
...
@@ -106,7 +106,7 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
if
pending
if
pending
expect
(
page
).
to
have_link
'Done'
expect
(
page
).
to
have_link
'Done'
else
else
expect
(
page
).
to_not
have_link
'Done'
expect
(
page
).
not_to
have_link
'Done'
end
end
end
end
end
end
...
...
features/steps/project/commits/commits.rb
View file @
75739e54
...
@@ -105,7 +105,7 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
...
@@ -105,7 +105,7 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
end
end
step
'I should not see button to create a new merge request'
do
step
'I should not see button to create a new merge request'
do
expect
(
page
).
to_not
have_link
'Create Merge Request'
expect
(
page
).
not_to
have_link
'Create Merge Request'
end
end
step
'I should see button to the merge request'
do
step
'I should see button to the merge request'
do
...
...
features/steps/project/issues/award_emoji.rb
View file @
75739e54
...
@@ -39,8 +39,8 @@ class Spinach::Features::AwardEmoji < Spinach::FeatureSteps
...
@@ -39,8 +39,8 @@ class Spinach::Features::AwardEmoji < Spinach::FeatureSteps
step
'I can see the activity and food categories'
do
step
'I can see the activity and food categories'
do
page
.
within
'.emoji-menu'
do
page
.
within
'.emoji-menu'
do
expect
(
page
).
to_not
have_selector
'Activity'
expect
(
page
).
not_to
have_selector
'Activity'
expect
(
page
).
to_not
have_selector
'Food'
expect
(
page
).
not_to
have_selector
'Food'
end
end
end
end
...
...
features/steps/project/issues/issues.rb
View file @
75739e54
...
@@ -216,7 +216,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
...
@@ -216,7 +216,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
page
.
within
'li.issue:nth-child(3)'
do
page
.
within
'li.issue:nth-child(3)'
do
expect
(
page
).
to
have_content
'Bugfix'
expect
(
page
).
to
have_content
'Bugfix'
expect
(
page
).
to_not
have_content
'0 0'
expect
(
page
).
not_to
have_content
'0 0'
end
end
end
end
end
end
...
@@ -235,7 +235,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
...
@@ -235,7 +235,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
page
.
within
'li.issue:nth-child(3)'
do
page
.
within
'li.issue:nth-child(3)'
do
expect
(
page
).
to
have_content
'Bugfix'
expect
(
page
).
to
have_content
'Bugfix'
expect
(
page
).
to_not
have_content
'0 0'
expect
(
page
).
not_to
have_content
'0 0'
end
end
end
end
end
end
...
...
features/steps/project/merge_requests.rb
View file @
75739e54
...
@@ -203,7 +203,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
...
@@ -203,7 +203,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
page
.
within
'li.merge-request:nth-child(3)'
do
page
.
within
'li.merge-request:nth-child(3)'
do
expect
(
page
).
to
have_content
'Bug NS-05'
expect
(
page
).
to
have_content
'Bug NS-05'
expect
(
page
).
to_not
have_content
'0 0'
expect
(
page
).
not_to
have_content
'0 0'
end
end
end
end
end
end
...
@@ -222,7 +222,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
...
@@ -222,7 +222,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
page
.
within
'li.merge-request:nth-child(3)'
do
page
.
within
'li.merge-request:nth-child(3)'
do
expect
(
page
).
to
have_content
'Bug NS-05'
expect
(
page
).
to
have_content
'Bug NS-05'
expect
(
page
).
to_not
have_content
'0 0'
expect
(
page
).
not_to
have_content
'0 0'
end
end
end
end
end
end
...
...
features/steps/shared/note.rb
View file @
75739e54
...
@@ -107,7 +107,7 @@ module SharedNote
...
@@ -107,7 +107,7 @@ module SharedNote
end
end
step
'I should see no notes at all'
do
step
'I should see no notes at all'
do
expect
(
page
).
to_not
have_css
(
'.note'
)
expect
(
page
).
not_to
have_css
(
'.note'
)
end
end
# Markdown
# Markdown
...
...
spec/controllers/admin/projects_controller_spec.rb
View file @
75739e54
...
@@ -17,7 +17,7 @@ describe Admin::ProjectsController do
...
@@ -17,7 +17,7 @@ describe Admin::ProjectsController do
it
'does not retrieve the project'
do
it
'does not retrieve the project'
do
get
:index
,
visibility_levels:
[
Gitlab
::
VisibilityLevel
::
INTERNAL
]
get
:index
,
visibility_levels:
[
Gitlab
::
VisibilityLevel
::
INTERNAL
]
expect
(
response
.
body
).
to_not
match
(
project
.
name
)
expect
(
response
.
body
).
not_to
match
(
project
.
name
)
end
end
end
end
end
end
spec/controllers/projects/compare_controller_spec.rb
View file @
75739e54
...
@@ -19,7 +19,7 @@ describe Projects::CompareController do
...
@@ -19,7 +19,7 @@ describe Projects::CompareController do
to:
ref_to
)
to:
ref_to
)
expect
(
response
).
to
be_success
expect
(
response
).
to
be_success
expect
(
assigns
(
:diffs
).
first
).
to_not
be_nil
expect
(
assigns
(
:diffs
).
first
).
not_to
be_nil
expect
(
assigns
(
:commits
).
length
).
to
be
>=
1
expect
(
assigns
(
:commits
).
length
).
to
be
>=
1
end
end
...
@@ -32,7 +32,7 @@ describe Projects::CompareController do
...
@@ -32,7 +32,7 @@ describe Projects::CompareController do
w:
1
)
w:
1
)
expect
(
response
).
to
be_success
expect
(
response
).
to
be_success
expect
(
assigns
(
:diffs
).
first
).
to_not
be_nil
expect
(
assigns
(
:diffs
).
first
).
not_to
be_nil
expect
(
assigns
(
:commits
).
length
).
to
be
>=
1
expect
(
assigns
(
:commits
).
length
).
to
be
>=
1
# without whitespace option, there are more than 2 diff_splits
# without whitespace option, there are more than 2 diff_splits
diff_splits
=
assigns
(
:diffs
).
first
.
diff
.
split
(
"
\n
"
)
diff_splits
=
assigns
(
:diffs
).
first
.
diff
.
split
(
"
\n
"
)
...
...
spec/controllers/projects/group_links_controller_spec.rb
View file @
75739e54
...
@@ -43,7 +43,7 @@ describe Projects::GroupLinksController do
...
@@ -43,7 +43,7 @@ describe Projects::GroupLinksController do
end
end
it
'does not share project with that group'
do
it
'does not share project with that group'
do
expect
(
group
.
shared_projects
).
to_not
include
project
expect
(
group
.
shared_projects
).
not_to
include
project
end
end
end
end
end
end
...
...
spec/controllers/projects/issues_controller_spec.rb
View file @
75739e54
...
@@ -56,7 +56,7 @@ describe Projects::IssuesController do
...
@@ -56,7 +56,7 @@ describe Projects::IssuesController do
move_issue
move_issue
expect
(
response
).
to
have_http_status
:found
expect
(
response
).
to
have_http_status
:found
expect
(
another_project
.
issues
).
to_not
be_empty
expect
(
another_project
.
issues
).
not_to
be_empty
end
end
end
end
...
...
spec/controllers/projects/project_members_controller_spec.rb
View file @
75739e54
...
@@ -38,7 +38,7 @@ describe Projects::ProjectMembersController do
...
@@ -38,7 +38,7 @@ describe Projects::ProjectMembersController do
include_context
'import applied'
include_context
'import applied'
it
'does not import team members'
do
it
'does not import team members'
do
expect
(
project
.
team_members
).
to_not
include
member
expect
(
project
.
team_members
).
not_to
include
member
end
end
it
'responds with not found'
do
it
'responds with not found'
do
...
...
spec/controllers/registrations_controller_spec.rb
View file @
75739e54
...
@@ -16,7 +16,7 @@ describe RegistrationsController do
...
@@ -16,7 +16,7 @@ describe RegistrationsController do
it
'logs user in directly'
do
it
'logs user in directly'
do
post
(
:create
,
user_params
)
post
(
:create
,
user_params
)
expect
(
ActionMailer
::
Base
.
deliveries
.
last
).
to
be_nil
expect
(
ActionMailer
::
Base
.
deliveries
.
last
).
to
be_nil
expect
(
subject
.
current_user
).
to_not
be_nil
expect
(
subject
.
current_user
).
not_to
be_nil
end
end
end
end
...
...
spec/controllers/sessions_controller_spec.rb
View file @
75739e54
...
@@ -47,7 +47,7 @@ describe SessionsController do
...
@@ -47,7 +47,7 @@ describe SessionsController do
authenticate_2fa
(
login:
another_user
.
username
,
authenticate_2fa
(
login:
another_user
.
username
,
otp_attempt:
another_user
.
current_otp
)
otp_attempt:
another_user
.
current_otp
)
expect
(
subject
.
current_user
).
to_not
eq
another_user
expect
(
subject
.
current_user
).
not_to
eq
another_user
end
end
end
end
...
@@ -56,7 +56,7 @@ describe SessionsController do
...
@@ -56,7 +56,7 @@ describe SessionsController do
authenticate_2fa
(
login:
another_user
.
username
,
authenticate_2fa
(
login:
another_user
.
username
,
otp_attempt:
'invalid'
)
otp_attempt:
'invalid'
)
expect
(
subject
.
current_user
).
to_not
eq
another_user
expect
(
subject
.
current_user
).
not_to
eq
another_user
end
end
end
end
...
@@ -73,7 +73,7 @@ describe SessionsController do
...
@@ -73,7 +73,7 @@ describe SessionsController do
before
{
authenticate_2fa
(
otp_attempt:
'invalid'
)
}
before
{
authenticate_2fa
(
otp_attempt:
'invalid'
)
}
it
'does not authenticate'
do
it
'does not authenticate'
do
expect
(
subject
.
current_user
).
to_not
eq
user
expect
(
subject
.
current_user
).
not_to
eq
user
end
end
it
'warns about invalid OTP code'
do
it
'warns about invalid OTP code'
do
...
...
spec/factories_spec.rb
View file @
75739e54
...
@@ -6,7 +6,7 @@ describe 'factories' do
...
@@ -6,7 +6,7 @@ describe 'factories' do
let
(
:entity
)
{
build
(
factory
.
name
)
}
let
(
:entity
)
{
build
(
factory
.
name
)
}
it
'does not raise error when created'
do
it
'does not raise error when created'
do
expect
{
entity
}.
to_not
raise_error
expect
{
entity
}.
not_to
raise_error
end
end
it
'should be valid'
,
if:
factory
.
build_class
<
ActiveRecord
::
Base
do
it
'should be valid'
,
if:
factory
.
build_class
<
ActiveRecord
::
Base
do
...
...
spec/features/admin/admin_runners_spec.rb
View file @
75739e54
...
@@ -79,7 +79,7 @@ describe "Admin Runners" do
...
@@ -79,7 +79,7 @@ describe "Admin Runners" do
end
end
it
'changes registration token'
do
it
'changes registration token'
do
expect
(
page_token
).
to_not
eq
token
expect
(
page_token
).
not_to
eq
token
end
end
end
end
end
end
...
...
spec/features/admin/admin_users_spec.rb
View file @
75739e54
...
@@ -152,7 +152,7 @@ describe "Admin::Users", feature: true do
...
@@ -152,7 +152,7 @@ describe "Admin::Users", feature: true do
it
'sees impersonation log out icon'
do
it
'sees impersonation log out icon'
do
icon
=
first
(
'.fa.fa-user-secret'
)
icon
=
first
(
'.fa.fa-user-secret'
)
expect
(
icon
).
to_not
eql
nil
expect
(
icon
).
not_to
eql
nil
end
end
it
'can log out of impersonated user back to original user'
do
it
'can log out of impersonated user back to original user'
do
...
...
spec/features/builds_spec.rb
View file @
75739e54
...
@@ -47,7 +47,7 @@ describe "Builds" do
...
@@ -47,7 +47,7 @@ describe "Builds" do
it
{
expect
(
page
).
to
have_content
@build
.
short_sha
}
it
{
expect
(
page
).
to
have_content
@build
.
short_sha
}
it
{
expect
(
page
).
to
have_content
@build
.
ref
}
it
{
expect
(
page
).
to
have_content
@build
.
ref
}
it
{
expect
(
page
).
to
have_content
@build
.
name
}
it
{
expect
(
page
).
to
have_content
@build
.
name
}
it
{
expect
(
page
).
to_not
have_link
'Cancel running'
}
it
{
expect
(
page
).
not_to
have_link
'Cancel running'
}
end
end
end
end
...
@@ -63,7 +63,7 @@ describe "Builds" do
...
@@ -63,7 +63,7 @@ describe "Builds" do
it
{
expect
(
page
).
to
have_content
@build
.
short_sha
}
it
{
expect
(
page
).
to
have_content
@build
.
short_sha
}
it
{
expect
(
page
).
to
have_content
@build
.
ref
}
it
{
expect
(
page
).
to
have_content
@build
.
ref
}
it
{
expect
(
page
).
to
have_content
@build
.
name
}
it
{
expect
(
page
).
to
have_content
@build
.
name
}
it
{
expect
(
page
).
to_not
have_link
'Cancel running'
}
it
{
expect
(
page
).
not_to
have_link
'Cancel running'
}
end
end
describe
"GET /:project/builds/:id"
do
describe
"GET /:project/builds/:id"
do
...
...
spec/features/commits_spec.rb
View file @
75739e54
...
@@ -137,8 +137,8 @@ describe 'Commits' do
...
@@ -137,8 +137,8 @@ describe 'Commits' do
expect
(
page
).
to
have_content
commit
.
git_commit_message
expect
(
page
).
to
have_content
commit
.
git_commit_message
expect
(
page
).
to
have_content
commit
.
git_author_name
expect
(
page
).
to
have_content
commit
.
git_author_name
expect
(
page
).
to
have_link
(
'Download artifacts'
)
expect
(
page
).
to
have_link
(
'Download artifacts'
)
expect
(
page
).
to_not
have_link
(
'Cancel running'
)
expect
(
page
).
not_to
have_link
(
'Cancel running'
)
expect
(
page
).
to_not
have_link
(
'Retry failed'
)
expect
(
page
).
not_to
have_link
(
'Retry failed'
)
end
end
end
end
...
@@ -155,9 +155,9 @@ describe 'Commits' do
...
@@ -155,9 +155,9 @@ describe 'Commits' do
expect
(
page
).
to
have_content
commit
.
sha
[
0
..
7
]
expect
(
page
).
to
have_content
commit
.
sha
[
0
..
7
]
expect
(
page
).
to
have_content
commit
.
git_commit_message
expect
(
page
).
to
have_content
commit
.
git_commit_message
expect
(
page
).
to
have_content
commit
.
git_author_name
expect
(
page
).
to
have_content
commit
.
git_author_name
expect
(
page
).
to_not
have_link
(
'Download artifacts'
)
expect
(
page
).
not_to
have_link
(
'Download artifacts'
)
expect
(
page
).
to_not
have_link
(
'Cancel running'
)
expect
(
page
).
not_to
have_link
(
'Cancel running'
)
expect
(
page
).
to_not
have_link
(
'Retry failed'
)
expect
(
page
).
not_to
have_link
(
'Retry failed'
)
end
end
end
end
end
end
...
...
spec/features/issues/update_issues_spec.rb
View file @
75739e54
...
@@ -95,7 +95,7 @@ feature 'Multiple issue updating from issues#index', feature: true do
...
@@ -95,7 +95,7 @@ feature 'Multiple issue updating from issues#index', feature: true do
find
(
'.dropdown-menu-milestone a'
,
text:
"No Milestone"
).
click
find
(
'.dropdown-menu-milestone a'
,
text:
"No Milestone"
).
click
click_update_issues_button
click_update_issues_button
expect
(
first
(
'.issue'
)).
to_not
have_content
milestone
.
title
expect
(
first
(
'.issue'
)).
not_to
have_content
milestone
.
title
end
end
end
end
...
...
spec/features/pipelines_spec.rb
View file @
75739e54
...
@@ -41,7 +41,7 @@ describe "Pipelines" do
...
@@ -41,7 +41,7 @@ describe "Pipelines" do
context
'when canceling'
do
context
'when canceling'
do
before
{
click_link
(
'Cancel'
)
}
before
{
click_link
(
'Cancel'
)
}
it
{
expect
(
page
).
to_not
have_link
(
'Cancel'
)
}
it
{
expect
(
page
).
not_to
have_link
(
'Cancel'
)
}
it
{
expect
(
page
).
to
have_selector
(
'.ci-canceled'
)
}
it
{
expect
(
page
).
to
have_selector
(
'.ci-canceled'
)
}
end
end
end
end
...
@@ -57,7 +57,7 @@ describe "Pipelines" do
...
@@ -57,7 +57,7 @@ describe "Pipelines" do
context
'when retrying'
do
context
'when retrying'
do
before
{
click_link
(
'Retry'
)
}
before
{
click_link
(
'Retry'
)
}
it
{
expect
(
page
).
to_not
have_link
(
'Retry'
)
}
it
{
expect
(
page
).
not_to
have_link
(
'Retry'
)
}
it
{
expect
(
page
).
to
have_selector
(
'.ci-pending'
)
}
it
{
expect
(
page
).
to
have_selector
(
'.ci-pending'
)
}
end
end
end
end
...
@@ -75,7 +75,7 @@ describe "Pipelines" do
...
@@ -75,7 +75,7 @@ describe "Pipelines" do
context
'without artifacts'
do
context
'without artifacts'
do
let!
(
:without_artifacts
)
{
create
(
:ci_build
,
:success
,
commit:
pipeline
,
name:
'rspec'
,
stage:
'test'
)
}
let!
(
:without_artifacts
)
{
create
(
:ci_build
,
:success
,
commit:
pipeline
,
name:
'rspec'
,
stage:
'test'
)
}
it
{
expect
(
page
).
to_not
have_selector
(
'.build-artifacts'
)
}
it
{
expect
(
page
).
not_to
have_selector
(
'.build-artifacts'
)
}
end
end
end
end
end
end
...
@@ -104,23 +104,23 @@ describe "Pipelines" do
...
@@ -104,23 +104,23 @@ describe "Pipelines" do
end
end
context
'retrying builds'
do
context
'retrying builds'
do
it
{
expect
(
page
).
to_not
have_content
(
'retried'
)
}
it
{
expect
(
page
).
not_to
have_content
(
'retried'
)
}
context
'when retrying'
do
context
'when retrying'
do
before
{
click_on
'Retry failed'
}
before
{
click_on
'Retry failed'
}
it
{
expect
(
page
).
to_not
have_content
(
'Retry failed'
)
}
it
{
expect
(
page
).
not_to
have_content
(
'Retry failed'
)
}
it
{
expect
(
page
).
to
have_content
(
'retried'
)
}
it
{
expect
(
page
).
to
have_content
(
'retried'
)
}
end
end
end
end
context
'canceling builds'
do
context
'canceling builds'
do
it
{
expect
(
page
).
to_not
have_selector
(
'.ci-canceled'
)
}
it
{
expect
(
page
).
not_to
have_selector
(
'.ci-canceled'
)
}
context
'when canceling'
do
context
'when canceling'
do
before
{
click_on
'Cancel running'
}
before
{
click_on
'Cancel running'
}
it
{
expect
(
page
).
to_not
have_content
(
'Cancel running'
)
}
it
{
expect
(
page
).
not_to
have_content
(
'Cancel running'
)
}
it
{
expect
(
page
).
to
have_selector
(
'.ci-canceled'
)
}
it
{
expect
(
page
).
to
have_selector
(
'.ci-canceled'
)
}
end
end
end
end
...
...
spec/features/runners_spec.rb
View file @
75739e54
...
@@ -29,8 +29,8 @@ describe "Runners" do
...
@@ -29,8 +29,8 @@ describe "Runners" do
end
end
before
do
before
do
expect
(
page
).
to_not
have_content
(
@specific_runner3
.
display_name
)
expect
(
page
).
not_to
have_content
(
@specific_runner3
.
display_name
)
expect
(
page
).
to_not
have_content
(
@specific_runner3
.
display_name
)
expect
(
page
).
not_to
have_content
(
@specific_runner3
.
display_name
)
end
end
it
"places runners in right places"
do
it
"places runners in right places"
do
...
...
spec/features/variables_spec.rb
View file @
75739e54
...
@@ -34,7 +34,7 @@ describe 'Project variables', js: true do
...
@@ -34,7 +34,7 @@ describe 'Project variables', js: true do
find
(
'.btn-variable-delete'
).
click
find
(
'.btn-variable-delete'
).
click
end
end
expect
(
page
).
to_not
have_selector
(
'variables-table'
)
expect
(
page
).
not_to
have_selector
(
'variables-table'
)
end
end
it
'should edit variable'
do
it
'should edit variable'
do
...
...
spec/helpers/auth_helper_spec.rb
View file @
75739e54
...
@@ -36,7 +36,7 @@ describe AuthHelper do
...
@@ -36,7 +36,7 @@ describe AuthHelper do
)
)
expect
(
helper
.
enabled_button_based_providers
).
to
include
(
'twitter'
)
expect
(
helper
.
enabled_button_based_providers
).
to
include
(
'twitter'
)
expect
(
helper
.
enabled_button_based_providers
).
to_not
include
(
'github'
)
expect
(
helper
.
enabled_button_based_providers
).
not_to
include
(
'github'
)
end
end
end
end
end
end
...
...
spec/helpers/merge_requests_helper_spec.rb
View file @
75739e54
...
@@ -17,7 +17,7 @@ describe MergeRequestsHelper do
...
@@ -17,7 +17,7 @@ describe MergeRequestsHelper do
it
'does not include api credentials in a link'
do
it
'does not include api credentials in a link'
do
allow
(
ci_service
).
allow
(
ci_service
).
to
receive
(
:build_page
).
and_return
(
"http://secretuser:secretpass@jenkins.example.com:8888/job/test1/scm/bySHA1/12d65c"
)
to
receive
(
:build_page
).
and_return
(
"http://secretuser:secretpass@jenkins.example.com:8888/job/test1/scm/bySHA1/12d65c"
)
expect
(
helper
.
ci_build_details_path
(
merge_request
)).
to_not
match
(
"secret"
)
expect
(
helper
.
ci_build_details_path
(
merge_request
)).
not_to
match
(
"secret"
)
end
end
end
end
...
...
spec/lib/award_emoji_spec.rb
View file @
75739e54
...
@@ -5,7 +5,7 @@ describe AwardEmoji do
...
@@ -5,7 +5,7 @@ describe AwardEmoji do
subject
{
AwardEmoji
.
urls
}
subject
{
AwardEmoji
.
urls
}
it
{
is_expected
.
to
be_an_instance_of
(
Array
)
}
it
{
is_expected
.
to
be_an_instance_of
(
Array
)
}
it
{
is_expected
.
to_not
be_empty
}
it
{
is_expected
.
not_to
be_empty
}
context
'every Hash in the Array'
do
context
'every Hash in the Array'
do
it
'has the correct keys and values'
do
it
'has the correct keys and values'
do
...
...
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
View file @
75739e54
...
@@ -619,19 +619,19 @@ module Ci
...
@@ -619,19 +619,19 @@ module Ci
context
'no dependencies'
do
context
'no dependencies'
do
let
(
:dependencies
)
{
}
let
(
:dependencies
)
{
}
it
{
expect
{
subject
}.
to_not
raise_error
}
it
{
expect
{
subject
}.
not_to
raise_error
}
end
end
context
'dependencies to builds'
do
context
'dependencies to builds'
do
let
(
:dependencies
)
{
[
'build1'
,
'build2'
]
}
let
(
:dependencies
)
{
[
'build1'
,
'build2'
]
}
it
{
expect
{
subject
}.
to_not
raise_error
}
it
{
expect
{
subject
}.
not_to
raise_error
}
end
end
context
'dependencies to builds defined as symbols'
do
context
'dependencies to builds defined as symbols'
do
let
(
:dependencies
)
{
[
:build1
,
:build2
]
}
let
(
:dependencies
)
{
[
:build1
,
:build2
]
}
it
{
expect
{
subject
}.
to_not
raise_error
}
it
{
expect
{
subject
}.
not_to
raise_error
}
end
end
context
'undefined dependency'
do
context
'undefined dependency'
do
...
...
spec/lib/container_registry/registry_spec.rb
View file @
75739e54
...
@@ -10,7 +10,7 @@ describe ContainerRegistry::Registry do
...
@@ -10,7 +10,7 @@ describe ContainerRegistry::Registry do
it
{
is_expected
.
to
respond_to
(
:uri
)
}
it
{
is_expected
.
to
respond_to
(
:uri
)
}
it
{
is_expected
.
to
respond_to
(
:path
)
}
it
{
is_expected
.
to
respond_to
(
:path
)
}
it
{
expect
(
subject
.
repository
(
'test'
)).
to_not
be_nil
}
it
{
expect
(
subject
.
repository
(
'test'
)).
not_to
be_nil
}
context
'#path'
do
context
'#path'
do
subject
{
registry
.
path
}
subject
{
registry
.
path
}
...
...
spec/lib/container_registry/repository_spec.rb
View file @
75739e54
...
@@ -6,7 +6,7 @@ describe ContainerRegistry::Repository do
...
@@ -6,7 +6,7 @@ describe ContainerRegistry::Repository do
it
{
expect
(
repository
).
to
respond_to
(
:registry
)
}
it
{
expect
(
repository
).
to
respond_to
(
:registry
)
}
it
{
expect
(
repository
).
to
delegate_method
(
:client
).
to
(
:registry
)
}
it
{
expect
(
repository
).
to
delegate_method
(
:client
).
to
(
:registry
)
}
it
{
expect
(
repository
.
tag
(
'test'
)).
to_not
be_nil
}
it
{
expect
(
repository
.
tag
(
'test'
)).
not_to
be_nil
}
context
'#path'
do
context
'#path'
do
subject
{
repository
.
path
}
subject
{
repository
.
path
}
...
@@ -27,7 +27,7 @@ describe ContainerRegistry::Repository do
...
@@ -27,7 +27,7 @@ describe ContainerRegistry::Repository do
context
'#manifest'
do
context
'#manifest'
do
subject
{
repository
.
manifest
}
subject
{
repository
.
manifest
}
it
{
is_expected
.
to_not
be_nil
}
it
{
is_expected
.
not_to
be_nil
}
end
end
context
'#valid?'
do
context
'#valid?'
do
...
@@ -39,7 +39,7 @@ describe ContainerRegistry::Repository do
...
@@ -39,7 +39,7 @@ describe ContainerRegistry::Repository do
context
'#tags'
do
context
'#tags'
do
subject
{
repository
.
tags
}
subject
{
repository
.
tags
}
it
{
is_expected
.
to_not
be_empty
}
it
{
is_expected
.
not_to
be_empty
}
end
end
end
end
...
...
spec/lib/container_registry/tag_spec.rb
View file @
75739e54
...
@@ -50,13 +50,13 @@ describe ContainerRegistry::Tag do
...
@@ -50,13 +50,13 @@ describe ContainerRegistry::Tag do
context
'#config'
do
context
'#config'
do
subject
{
tag
.
config
}
subject
{
tag
.
config
}
it
{
is_expected
.
to_not
be_nil
}
it
{
is_expected
.
not_to
be_nil
}
end
end
context
'#created_at'
do
context
'#created_at'
do
subject
{
tag
.
created_at
}
subject
{
tag
.
created_at
}
it
{
is_expected
.
to_not
be_nil
}
it
{
is_expected
.
not_to
be_nil
}
end
end
end
end
end
end
...
...
spec/lib/gitlab/bitbucket_import/client_spec.rb
View file @
75739e54
...
@@ -59,7 +59,7 @@ describe Gitlab::BitbucketImport::Client, lib: true do
...
@@ -59,7 +59,7 @@ describe Gitlab::BitbucketImport::Client, lib: true do
bitbucket_access_token_secret:
"test"
}
})
bitbucket_access_token_secret:
"test"
}
})
project
.
import_url
=
"ssh://git@bitbucket.org/test/test.git"
project
.
import_url
=
"ssh://git@bitbucket.org/test/test.git"
expect
{
described_class
.
from_project
(
project
)
}.
to_not
raise_error
expect
{
described_class
.
from_project
(
project
)
}.
not_to
raise_error
end
end
end
end
end
end
spec/lib/gitlab/ci/build/artifacts/metadata/entry_spec.rb
View file @
75739e54
...
@@ -122,7 +122,7 @@ describe Gitlab::Ci::Build::Artifacts::Metadata::Entry do
...
@@ -122,7 +122,7 @@ describe Gitlab::Ci::Build::Artifacts::Metadata::Entry do
describe
'empty path'
,
path:
''
do
describe
'empty path'
,
path:
''
do
subject
{
|
example
|
path
(
example
)
}
subject
{
|
example
|
path
(
example
)
}
it
{
is_expected
.
to_not
have_parent
}
it
{
is_expected
.
not_to
have_parent
}
describe
'#children'
do
describe
'#children'
do
subject
{
|
example
|
path
(
example
).
children
}
subject
{
|
example
|
path
(
example
).
children
}
...
...
spec/lib/gitlab/gfm/reference_rewriter_spec.rb
View file @
75739e54
...
@@ -33,8 +33,8 @@ describe Gitlab::Gfm::ReferenceRewriter do
...
@@ -33,8 +33,8 @@ describe Gitlab::Gfm::ReferenceRewriter do
end
end
it
{
is_expected
.
to
include
issue_first
.
to_reference
(
new_project
)
}
it
{
is_expected
.
to
include
issue_first
.
to_reference
(
new_project
)
}
it
{
is_expected
.
to_not
include
issue_second
.
to_reference
(
new_project
)
}
it
{
is_expected
.
not_to
include
issue_second
.
to_reference
(
new_project
)
}
it
{
is_expected
.
to_not
include
merge_request
.
to_reference
(
new_project
)
}
it
{
is_expected
.
not_to
include
merge_request
.
to_reference
(
new_project
)
}
end
end
context
'description ambigous elements'
do
context
'description ambigous elements'
do
...
...
spec/lib/gitlab/gfm/uploads_rewriter_spec.rb
View file @
75739e54
...
@@ -32,13 +32,13 @@ describe Gitlab::Gfm::UploadsRewriter do
...
@@ -32,13 +32,13 @@ describe Gitlab::Gfm::UploadsRewriter do
let
(
:new_paths
)
{
new_files
.
map
(
&
:path
)
}
let
(
:new_paths
)
{
new_files
.
map
(
&
:path
)
}
it
'rewrites content'
do
it
'rewrites content'
do
expect
(
new_text
).
to_not
eq
text
expect
(
new_text
).
not_to
eq
text
expect
(
new_text
.
length
).
to
eq
text
.
length
expect
(
new_text
.
length
).
to
eq
text
.
length
end
end
it
'copies files'
do
it
'copies files'
do
expect
(
new_files
).
to
all
(
exist
)
expect
(
new_files
).
to
all
(
exist
)
expect
(
old_paths
).
to_not
match_array
new_paths
expect
(
old_paths
).
not_to
match_array
new_paths
expect
(
old_paths
).
to
all
(
include
(
old_project
.
path_with_namespace
))
expect
(
old_paths
).
to
all
(
include
(
old_project
.
path_with_namespace
))
expect
(
new_paths
).
to
all
(
include
(
new_project
.
path_with_namespace
))
expect
(
new_paths
).
to
all
(
include
(
new_project
.
path_with_namespace
))
end
end
...
@@ -48,8 +48,8 @@ describe Gitlab::Gfm::UploadsRewriter do
...
@@ -48,8 +48,8 @@ describe Gitlab::Gfm::UploadsRewriter do
end
end
it
'generates a new secret for each file'
do
it
'generates a new secret for each file'
do
expect
(
new_paths
).
to_not
include
image_uploader
.
secret
expect
(
new_paths
).
not_to
include
image_uploader
.
secret
expect
(
new_paths
).
to_not
include
zip_uploader
.
secret
expect
(
new_paths
).
not_to
include
zip_uploader
.
secret
end
end
end
end
...
...
spec/lib/gitlab/lfs/lfs_router_spec.rb
View file @
75739e54
...
@@ -368,7 +368,7 @@ describe Gitlab::Lfs::Router, lib: true do
...
@@ -368,7 +368,7 @@ describe Gitlab::Lfs::Router, lib: true do
expect
(
response
[
'objects'
]).
to
be_kind_of
(
Array
)
expect
(
response
[
'objects'
]).
to
be_kind_of
(
Array
)
expect
(
response
[
'objects'
].
first
[
'oid'
]).
to
eq
(
sample_oid
)
expect
(
response
[
'objects'
].
first
[
'oid'
]).
to
eq
(
sample_oid
)
expect
(
response
[
'objects'
].
first
[
'size'
]).
to
eq
(
sample_size
)
expect
(
response
[
'objects'
].
first
[
'size'
]).
to
eq
(
sample_size
)
expect
(
lfs_object
.
projects
.
pluck
(
:id
)).
to_not
include
(
project
.
id
)
expect
(
lfs_object
.
projects
.
pluck
(
:id
)).
not_to
include
(
project
.
id
)
expect
(
lfs_object
.
projects
.
pluck
(
:id
)).
to
include
(
public_project
.
id
)
expect
(
lfs_object
.
projects
.
pluck
(
:id
)).
to
include
(
public_project
.
id
)
expect
(
response
[
'objects'
].
first
[
'actions'
][
'upload'
][
'href'
]).
to
eq
(
"
#{
Gitlab
.
config
.
gitlab
.
url
}
/
#{
project
.
path_with_namespace
}
.git/gitlab-lfs/objects/
#{
sample_oid
}
/
#{
sample_size
}
"
)
expect
(
response
[
'objects'
].
first
[
'actions'
][
'upload'
][
'href'
]).
to
eq
(
"
#{
Gitlab
.
config
.
gitlab
.
url
}
/
#{
project
.
path_with_namespace
}
.git/gitlab-lfs/objects/
#{
sample_oid
}
/
#{
sample_size
}
"
)
expect
(
response
[
'objects'
].
first
[
'actions'
][
'upload'
][
'header'
]).
to
eq
(
'Authorization'
=>
@auth
)
expect
(
response
[
'objects'
].
first
[
'actions'
][
'upload'
][
'header'
]).
to
eq
(
'Authorization'
=>
@auth
)
...
@@ -430,7 +430,7 @@ describe Gitlab::Lfs::Router, lib: true do
...
@@ -430,7 +430,7 @@ describe Gitlab::Lfs::Router, lib: true do
expect
(
response_body
[
'objects'
].
last
[
'oid'
]).
to
eq
(
sample_oid
)
expect
(
response_body
[
'objects'
].
last
[
'oid'
]).
to
eq
(
sample_oid
)
expect
(
response_body
[
'objects'
].
last
[
'size'
]).
to
eq
(
sample_size
)
expect
(
response_body
[
'objects'
].
last
[
'size'
]).
to
eq
(
sample_size
)
expect
(
response_body
[
'objects'
].
last
).
to_not
have_key
(
'actions'
)
expect
(
response_body
[
'objects'
].
last
).
not_to
have_key
(
'actions'
)
end
end
end
end
end
end
...
...
spec/lib/gitlab/metrics/instrumentation_spec.rb
View file @
75739e54
...
@@ -67,7 +67,7 @@ describe Gitlab::Metrics::Instrumentation do
...
@@ -67,7 +67,7 @@ describe Gitlab::Metrics::Instrumentation do
allow
(
Gitlab
::
Metrics
).
to
receive
(
:method_call_threshold
).
allow
(
Gitlab
::
Metrics
).
to
receive
(
:method_call_threshold
).
and_return
(
100
)
and_return
(
100
)
expect
(
transaction
).
to_not
receive
(
:add_metric
)
expect
(
transaction
).
not_to
receive
(
:add_metric
)
@dummy
.
foo
@dummy
.
foo
end
end
...
@@ -147,7 +147,7 @@ describe Gitlab::Metrics::Instrumentation do
...
@@ -147,7 +147,7 @@ describe Gitlab::Metrics::Instrumentation do
allow
(
Gitlab
::
Metrics
).
to
receive
(
:method_call_threshold
).
allow
(
Gitlab
::
Metrics
).
to
receive
(
:method_call_threshold
).
and_return
(
100
)
and_return
(
100
)
expect
(
transaction
).
to_not
receive
(
:add_metric
)
expect
(
transaction
).
not_to
receive
(
:add_metric
)
@dummy
.
new
.
bar
@dummy
.
new
.
bar
end
end
...
@@ -220,7 +220,7 @@ describe Gitlab::Metrics::Instrumentation do
...
@@ -220,7 +220,7 @@ describe Gitlab::Metrics::Instrumentation do
described_class
.
instrument_methods
(
@dummy
)
described_class
.
instrument_methods
(
@dummy
)
expect
(
@dummy
).
to_not
respond_to
(
:_original_kittens
)
expect
(
@dummy
).
not_to
respond_to
(
:_original_kittens
)
end
end
it
'can take a block to determine if a method should be instrumented'
do
it
'can take a block to determine if a method should be instrumented'
do
...
@@ -228,7 +228,7 @@ describe Gitlab::Metrics::Instrumentation do
...
@@ -228,7 +228,7 @@ describe Gitlab::Metrics::Instrumentation do
false
false
end
end
expect
(
@dummy
).
to_not
respond_to
(
:_original_foo
)
expect
(
@dummy
).
not_to
respond_to
(
:_original_foo
)
end
end
end
end
...
...
spec/lib/gitlab/metrics/sampler_spec.rb
View file @
75739e54
...
@@ -130,7 +130,7 @@ describe Gitlab::Metrics::Sampler do
...
@@ -130,7 +130,7 @@ describe Gitlab::Metrics::Sampler do
100
.
times
do
100
.
times
do
interval
=
sampler
.
sleep_interval
interval
=
sampler
.
sleep_interval
expect
(
interval
).
to_not
eq
(
last
)
expect
(
interval
).
not_to
eq
(
last
)
last
=
interval
last
=
interval
end
end
...
...
spec/lib/gitlab/metrics/subscribers/active_record_spec.rb
View file @
75739e54
...
@@ -13,7 +13,7 @@ describe Gitlab::Metrics::Subscribers::ActiveRecord do
...
@@ -13,7 +13,7 @@ describe Gitlab::Metrics::Subscribers::ActiveRecord do
describe
'without a current transaction'
do
describe
'without a current transaction'
do
it
'simply returns'
do
it
'simply returns'
do
expect_any_instance_of
(
Gitlab
::
Metrics
::
Transaction
).
expect_any_instance_of
(
Gitlab
::
Metrics
::
Transaction
).
to_not
receive
(
:increment
)
not_to
receive
(
:increment
)
subscriber
.
sql
(
event
)
subscriber
.
sql
(
event
)
end
end
...
...
spec/lib/gitlab/sherlock/collection_spec.rb
View file @
75739e54
...
@@ -11,13 +11,13 @@ describe Gitlab::Sherlock::Collection, lib: true do
...
@@ -11,13 +11,13 @@ describe Gitlab::Sherlock::Collection, lib: true do
it
'adds a new transaction'
do
it
'adds a new transaction'
do
collection
.
add
(
transaction
)
collection
.
add
(
transaction
)
expect
(
collection
).
to_not
be_empty
expect
(
collection
).
not_to
be_empty
end
end
it
'is aliased as <<'
do
it
'is aliased as <<'
do
collection
<<
transaction
collection
<<
transaction
expect
(
collection
).
to_not
be_empty
expect
(
collection
).
not_to
be_empty
end
end
end
end
...
@@ -47,7 +47,7 @@ describe Gitlab::Sherlock::Collection, lib: true do
...
@@ -47,7 +47,7 @@ describe Gitlab::Sherlock::Collection, lib: true do
it
'returns false for a collection with a transaction'
do
it
'returns false for a collection with a transaction'
do
collection
.
add
(
transaction
)
collection
.
add
(
transaction
)
expect
(
collection
).
to_not
be_empty
expect
(
collection
).
not_to
be_empty
end
end
end
end
...
...
spec/lib/gitlab/sherlock/query_spec.rb
View file @
75739e54
...
@@ -85,7 +85,7 @@ FROM users;
...
@@ -85,7 +85,7 @@ FROM users;
frames
=
query
.
application_backtrace
frames
=
query
.
application_backtrace
expect
(
frames
).
to
be_an_instance_of
(
Array
)
expect
(
frames
).
to
be_an_instance_of
(
Array
)
expect
(
frames
).
to_not
be_empty
expect
(
frames
).
not_to
be_empty
frames
.
each
do
|
frame
|
frames
.
each
do
|
frame
|
expect
(
frame
.
path
).
to
start_with
(
Rails
.
root
.
to_s
)
expect
(
frame
.
path
).
to
start_with
(
Rails
.
root
.
to_s
)
...
...
spec/lib/gitlab/sherlock/transaction_spec.rb
View file @
75739e54
...
@@ -203,7 +203,7 @@ describe Gitlab::Sherlock::Transaction, lib: true do
...
@@ -203,7 +203,7 @@ describe Gitlab::Sherlock::Transaction, lib: true do
end
end
it
'only tracks queries triggered from the transaction thread'
do
it
'only tracks queries triggered from the transaction thread'
do
expect
(
transaction
).
to_not
receive
(
:track_query
)
expect
(
transaction
).
not_to
receive
(
:track_query
)
Thread
.
new
{
subscription
.
publish
(
'test'
,
time
,
time
,
nil
,
query_data
)
}.
Thread
.
new
{
subscription
.
publish
(
'test'
,
time
,
time
,
nil
,
query_data
)
}.
join
join
...
@@ -226,7 +226,7 @@ describe Gitlab::Sherlock::Transaction, lib: true do
...
@@ -226,7 +226,7 @@ describe Gitlab::Sherlock::Transaction, lib: true do
end
end
it
'only tracks views rendered from the transaction thread'
do
it
'only tracks views rendered from the transaction thread'
do
expect
(
transaction
).
to_not
receive
(
:track_view
)
expect
(
transaction
).
not_to
receive
(
:track_view
)
Thread
.
new
{
subscription
.
publish
(
'test'
,
time
,
time
,
nil
,
view_data
)
}.
Thread
.
new
{
subscription
.
publish
(
'test'
,
time
,
time
,
nil
,
view_data
)
}.
join
join
...
...
spec/lib/json_web_token/rsa_token_spec.rb
View file @
75739e54
...
@@ -23,7 +23,7 @@ describe JSONWebToken::RSAToken do
...
@@ -23,7 +23,7 @@ describe JSONWebToken::RSAToken do
subject
{
JWT
.
decode
(
rsa_encoded
,
rsa_key
)
}
subject
{
JWT
.
decode
(
rsa_encoded
,
rsa_key
)
}
it
{
expect
{
subject
}.
to_not
raise_error
}
it
{
expect
{
subject
}.
not_to
raise_error
}
it
{
expect
(
subject
.
first
).
to
include
(
'key'
=>
'value'
)
}
it
{
expect
(
subject
.
first
).
to
include
(
'key'
=>
'value'
)
}
it
do
it
do
expect
(
subject
.
second
).
to
eq
(
expect
(
subject
.
second
).
to
eq
(
...
...
spec/mailers/shared/notify.rb
View file @
75739e54
...
@@ -146,8 +146,8 @@ shared_examples 'it should have Gmail Actions links' do
...
@@ -146,8 +146,8 @@ shared_examples 'it should have Gmail Actions links' do
end
end
shared_examples
'it should not have Gmail Actions links'
do
shared_examples
'it should not have Gmail Actions links'
do
it
{
is_expected
.
to_not
have_body_text
'<script type="application/ld+json">'
}
it
{
is_expected
.
not_to
have_body_text
'<script type="application/ld+json">'
}
it
{
is_expected
.
to_not
have_body_text
/ViewAction/
}
it
{
is_expected
.
not_to
have_body_text
/ViewAction/
}
end
end
shared_examples
'it should show Gmail Actions View Issue link'
do
shared_examples
'it should show Gmail Actions View Issue link'
do
...
...
spec/models/build_spec.rb
View file @
75739e54
...
@@ -90,7 +90,7 @@ describe Ci::Build, models: true do
...
@@ -90,7 +90,7 @@ describe Ci::Build, models: true do
build
.
update_attributes
(
trace:
token
)
build
.
update_attributes
(
trace:
token
)
end
end
it
{
is_expected
.
to_not
include
(
token
)
}
it
{
is_expected
.
not_to
include
(
token
)
}
end
end
end
end
...
@@ -317,7 +317,7 @@ describe Ci::Build, models: true do
...
@@ -317,7 +317,7 @@ describe Ci::Build, models: true do
context
'when build does not have tags'
do
context
'when build does not have tags'
do
subject
{
create
(
:ci_build
,
tag_list:
[])
}
subject
{
create
(
:ci_build
,
tag_list:
[])
}
it
{
is_expected
.
to_not
have_tags
}
it
{
is_expected
.
not_to
have_tags
}
end
end
end
end
...
@@ -534,7 +534,7 @@ describe Ci::Build, models: true do
...
@@ -534,7 +534,7 @@ describe Ci::Build, models: true do
end
end
it
'should set erase date'
do
it
'should set erase date'
do
expect
(
build
.
erased_at
).
to_not
be_falsy
expect
(
build
.
erased_at
).
not_to
be_falsy
end
end
end
end
...
@@ -606,7 +606,7 @@ describe Ci::Build, models: true do
...
@@ -606,7 +606,7 @@ describe Ci::Build, models: true do
describe
'#erase'
do
describe
'#erase'
do
it
'should not raise error'
do
it
'should not raise error'
do
expect
{
build
.
erase
}.
to_not
raise_error
expect
{
build
.
erase
}.
not_to
raise_error
end
end
end
end
end
end
...
...
spec/models/ci/commit_spec.rb
View file @
75739e54
...
@@ -247,7 +247,7 @@ describe Ci::Commit, models: true do
...
@@ -247,7 +247,7 @@ describe Ci::Commit, models: true do
expect
(
commit
.
builds
.
pluck
(
:status
)).
to
contain_exactly
(
'pending'
)
expect
(
commit
.
builds
.
pluck
(
:status
)).
to
contain_exactly
(
'pending'
)
commit
.
builds
.
running_or_pending
.
each
(
&
:success
)
commit
.
builds
.
running_or_pending
.
each
(
&
:success
)
expect
(
commit
.
builds
.
running_or_pending
).
to_not
be_empty
expect
(
commit
.
builds
.
running_or_pending
).
not_to
be_empty
expect
(
commit
.
builds
.
pluck
(
:name
)).
to
contain_exactly
(
'build'
,
'test'
)
expect
(
commit
.
builds
.
pluck
(
:name
)).
to
contain_exactly
(
'build'
,
'test'
)
expect
(
commit
.
builds
.
pluck
(
:status
)).
to
contain_exactly
(
'success'
,
'pending'
)
expect
(
commit
.
builds
.
pluck
(
:status
)).
to
contain_exactly
(
'success'
,
'pending'
)
...
...
spec/models/ci/runner_spec.rb
View file @
75739e54
...
@@ -140,7 +140,7 @@ describe Ci::Runner, models: true do
...
@@ -140,7 +140,7 @@ describe Ci::Runner, models: true do
context
'when runner does not have tags'
do
context
'when runner does not have tags'
do
subject
{
create
(
:ci_runner
,
tag_list:
[])
}
subject
{
create
(
:ci_runner
,
tag_list:
[])
}
it
{
is_expected
.
to_not
have_tags
}
it
{
is_expected
.
not_to
have_tags
}
end
end
end
end
...
...
spec/models/concerns/issuable_spec.rb
View file @
75739e54
...
@@ -165,7 +165,7 @@ describe Issue, "Issuable" do
...
@@ -165,7 +165,7 @@ describe Issue, "Issuable" do
expect
(
data
[
:object_kind
]).
to
eq
(
"issue"
)
expect
(
data
[
:object_kind
]).
to
eq
(
"issue"
)
expect
(
data
[
:user
]).
to
eq
(
user
.
hook_attrs
)
expect
(
data
[
:user
]).
to
eq
(
user
.
hook_attrs
)
expect
(
data
[
:object_attributes
]).
to
eq
(
issue
.
hook_attrs
)
expect
(
data
[
:object_attributes
]).
to
eq
(
issue
.
hook_attrs
)
expect
(
data
).
to_not
have_key
(
:assignee
)
expect
(
data
).
not_to
have_key
(
:assignee
)
end
end
context
"issue is assigned"
do
context
"issue is assigned"
do
...
...
spec/models/concerns/token_authenticatable_spec.rb
View file @
75739e54
...
@@ -28,14 +28,14 @@ describe ApplicationSetting, 'TokenAuthenticatable' do
...
@@ -28,14 +28,14 @@ describe ApplicationSetting, 'TokenAuthenticatable' do
context
'token is not generated yet'
do
context
'token is not generated yet'
do
describe
'token field accessor'
do
describe
'token field accessor'
do
subject
{
described_class
.
new
.
send
(
token_field
)
}
subject
{
described_class
.
new
.
send
(
token_field
)
}
it
{
is_expected
.
to_not
be_blank
}
it
{
is_expected
.
not_to
be_blank
}
end
end
describe
'ensured token'
do
describe
'ensured token'
do
subject
{
described_class
.
new
.
send
(
"ensure_
#{
token_field
}
"
)
}
subject
{
described_class
.
new
.
send
(
"ensure_
#{
token_field
}
"
)
}
it
{
is_expected
.
to
be_a
String
}
it
{
is_expected
.
to
be_a
String
}
it
{
is_expected
.
to_not
be_blank
}
it
{
is_expected
.
not_to
be_blank
}
end
end
describe
'ensured! token'
do
describe
'ensured! token'
do
...
...
spec/models/generic_commit_status_spec.rb
View file @
75739e54
...
@@ -27,13 +27,13 @@ describe GenericCommitStatus, models: true do
...
@@ -27,13 +27,13 @@ describe GenericCommitStatus, models: true do
describe
:context
do
describe
:context
do
subject
{
generic_commit_status
.
context
}
subject
{
generic_commit_status
.
context
}
it
{
is_expected
.
to_not
be_nil
}
it
{
is_expected
.
not_to
be_nil
}
end
end
describe
:stage
do
describe
:stage
do
subject
{
generic_commit_status
.
stage
}
subject
{
generic_commit_status
.
stage
}
it
{
is_expected
.
to_not
be_nil
}
it
{
is_expected
.
not_to
be_nil
}
end
end
end
end
end
end
spec/models/issue_spec.rb
View file @
75739e54
...
@@ -192,7 +192,7 @@ describe Issue, models: true do
...
@@ -192,7 +192,7 @@ describe Issue, models: true do
source_project:
subject
.
project
,
source_project:
subject
.
project
,
source_branch:
"
#{
subject
.
iid
}
-branch"
})
source_branch:
"
#{
subject
.
iid
}
-branch"
})
merge_request
.
create_cross_references!
(
user
)
merge_request
.
create_cross_references!
(
user
)
expect
(
subject
.
referenced_merge_requests
).
to_not
be_empty
expect
(
subject
.
referenced_merge_requests
).
not_to
be_empty
expect
(
subject
.
related_branches
(
user
)).
to
eq
([
subject
.
to_branch_name
])
expect
(
subject
.
related_branches
(
user
)).
to
eq
([
subject
.
to_branch_name
])
end
end
...
...
spec/models/project_services/hipchat_service_spec.rb
View file @
75739e54
...
@@ -303,7 +303,7 @@ describe HipchatService, models: true do
...
@@ -303,7 +303,7 @@ describe HipchatService, models: true do
it
"should notify only broken"
do
it
"should notify only broken"
do
hipchat
.
notify_only_broken_builds
=
true
hipchat
.
notify_only_broken_builds
=
true
hipchat
.
execute
(
data
)
hipchat
.
execute
(
data
)
expect
(
WebMock
).
to_not
have_requested
(
:post
,
api_url
).
once
expect
(
WebMock
).
not_to
have_requested
(
:post
,
api_url
).
once
end
end
end
end
end
end
...
...
spec/models/project_spec.rb
View file @
75739e54
...
@@ -791,7 +791,7 @@ describe Project, models: true do
...
@@ -791,7 +791,7 @@ describe Project, models: true do
subject
{
project
.
container_registry_repository
}
subject
{
project
.
container_registry_repository
}
it
{
is_expected
.
to_not
be_nil
}
it
{
is_expected
.
not_to
be_nil
}
end
end
describe
'#container_registry_repository_url'
do
describe
'#container_registry_repository_url'
do
...
@@ -809,7 +809,7 @@ describe Project, models: true do
...
@@ -809,7 +809,7 @@ describe Project, models: true do
}
}
end
end
it
{
is_expected
.
to_not
be_nil
}
it
{
is_expected
.
not_to
be_nil
}
end
end
context
'for disabled registry'
do
context
'for disabled registry'
do
...
...
spec/models/repository_spec.rb
View file @
75739e54
...
@@ -443,7 +443,7 @@ describe Repository, models: true do
...
@@ -443,7 +443,7 @@ describe Repository, models: true do
end
end
it
'does nothing'
do
it
'does nothing'
do
expect
(
repository
.
raw_repository
).
to_not
receive
(
:autocrlf
=
).
expect
(
repository
.
raw_repository
).
not_to
receive
(
:autocrlf
=
).
with
(
:input
)
with
(
:input
)
repository
.
update_autocrlf_option
repository
.
update_autocrlf_option
...
@@ -511,7 +511,7 @@ describe Repository, models: true do
...
@@ -511,7 +511,7 @@ describe Repository, models: true do
it
'does not expire the emptiness caches for a non-empty repository'
do
it
'does not expire the emptiness caches for a non-empty repository'
do
expect
(
repository
).
to
receive
(
:empty?
).
and_return
(
false
)
expect
(
repository
).
to
receive
(
:empty?
).
and_return
(
false
)
expect
(
repository
).
to_not
receive
(
:expire_emptiness_caches
)
expect
(
repository
).
not_to
receive
(
:expire_emptiness_caches
)
repository
.
expire_cache
repository
.
expire_cache
end
end
...
@@ -674,7 +674,7 @@ describe Repository, models: true do
...
@@ -674,7 +674,7 @@ describe Repository, models: true do
end
end
it
'does not flush caches that depend on repository data'
do
it
'does not flush caches that depend on repository data'
do
expect
(
repository
).
to_not
receive
(
:expire_cache
)
expect
(
repository
).
not_to
receive
(
:expire_cache
)
repository
.
before_delete
repository
.
before_delete
end
end
...
@@ -951,7 +951,7 @@ describe Repository, models: true do
...
@@ -951,7 +951,7 @@ describe Repository, models: true do
expect
(
repository
.
avatar
).
to
eq
(
'logo.png'
)
expect
(
repository
.
avatar
).
to
eq
(
'logo.png'
)
expect
(
repository
).
to_not
receive
(
:blob_at_branch
)
expect
(
repository
).
not_to
receive
(
:blob_at_branch
)
expect
(
repository
.
avatar
).
to
eq
(
'logo.png'
)
expect
(
repository
.
avatar
).
to
eq
(
'logo.png'
)
end
end
end
end
...
@@ -1045,7 +1045,7 @@ describe Repository, models: true do
...
@@ -1045,7 +1045,7 @@ describe Repository, models: true do
and_return
(
true
)
and_return
(
true
)
repository
.
cache_keys
.
each
do
|
key
|
repository
.
cache_keys
.
each
do
|
key
|
expect
(
repository
).
to_not
receive
(
key
)
expect
(
repository
).
not_to
receive
(
key
)
end
end
repository
.
build_cache
repository
.
build_cache
...
...
spec/requests/api/project_members_spec.rb
View file @
75739e54
...
@@ -133,7 +133,7 @@ describe API::API, api: true do
...
@@ -133,7 +133,7 @@ describe API::API, api: true do
delete
api
(
"/projects/
#{
project
.
id
}
/members/
#{
user3
.
id
}
"
,
user
)
delete
api
(
"/projects/
#{
project
.
id
}
/members/
#{
user3
.
id
}
"
,
user
)
expect
do
expect
do
delete
api
(
"/projects/
#{
project
.
id
}
/members/
#{
user3
.
id
}
"
,
user
)
delete
api
(
"/projects/
#{
project
.
id
}
/members/
#{
user3
.
id
}
"
,
user
)
end
.
to_not
change
{
ProjectMember
.
count
}
end
.
not_to
change
{
ProjectMember
.
count
}
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
.
status
).
to
eq
(
200
)
end
end
...
...
spec/requests/api/system_hooks_spec.rb
View file @
75739e54
...
@@ -49,7 +49,7 @@ describe API::API, api: true do
...
@@ -49,7 +49,7 @@ describe API::API, api: true do
it
"should not create new hook without url"
do
it
"should not create new hook without url"
do
expect
do
expect
do
post
api
(
"/hooks"
,
admin
)
post
api
(
"/hooks"
,
admin
)
end
.
to_not
change
{
SystemHook
.
count
}
end
.
not_to
change
{
SystemHook
.
count
}
end
end
end
end
...
...
spec/requests/ci/api/builds_spec.rb
View file @
75739e54
...
@@ -253,13 +253,13 @@ describe Ci::API::API do
...
@@ -253,13 +253,13 @@ describe Ci::API::API do
it
"using token as parameter"
do
it
"using token as parameter"
do
post
authorize_url
,
{
token:
build
.
token
},
headers
post
authorize_url
,
{
token:
build
.
token
},
headers
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
json_response
[
"TempPath"
]).
to_not
be_nil
expect
(
json_response
[
"TempPath"
]).
not_to
be_nil
end
end
it
"using token as header"
do
it
"using token as header"
do
post
authorize_url
,
{},
headers_with_token
post
authorize_url
,
{},
headers_with_token
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
json_response
[
"TempPath"
]).
to_not
be_nil
expect
(
json_response
[
"TempPath"
]).
not_to
be_nil
end
end
end
end
...
...
spec/services/auth/container_registry_authentication_service_spec.rb
View file @
75739e54
...
@@ -52,12 +52,12 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
...
@@ -52,12 +52,12 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
shared_examples
'an unauthorized'
do
shared_examples
'an unauthorized'
do
it
{
is_expected
.
to
include
(
http_status:
401
)
}
it
{
is_expected
.
to
include
(
http_status:
401
)
}
it
{
is_expected
.
to_not
include
(
:token
)
}
it
{
is_expected
.
not_to
include
(
:token
)
}
end
end
shared_examples
'a forbidden'
do
shared_examples
'a forbidden'
do
it
{
is_expected
.
to
include
(
http_status:
403
)
}
it
{
is_expected
.
to
include
(
http_status:
403
)
}
it
{
is_expected
.
to_not
include
(
:token
)
}
it
{
is_expected
.
not_to
include
(
:token
)
}
end
end
describe
'#full_access_token'
do
describe
'#full_access_token'
do
...
...
spec/services/create_commit_builds_service_spec.rb
View file @
75739e54
...
@@ -78,7 +78,7 @@ describe CreateCommitBuildsService, services: true do
...
@@ -78,7 +78,7 @@ describe CreateCommitBuildsService, services: true do
expect
(
commit
).
to
be_persisted
expect
(
commit
).
to
be_persisted
expect
(
commit
.
builds
.
any?
).
to
be
false
expect
(
commit
.
builds
.
any?
).
to
be
false
expect
(
commit
.
status
).
to
eq
(
'failed'
)
expect
(
commit
.
status
).
to
eq
(
'failed'
)
expect
(
commit
.
yaml_errors
).
to_not
be_nil
expect
(
commit
.
yaml_errors
).
not_to
be_nil
end
end
describe
:ci_skip?
do
describe
:ci_skip?
do
...
...
spec/services/groups/create_service_spec.rb
View file @
75739e54
...
@@ -14,7 +14,7 @@ describe Groups::CreateService, services: true do
...
@@ -14,7 +14,7 @@ describe Groups::CreateService, services: true do
context
"cannot create group with restricted visibility level"
do
context
"cannot create group with restricted visibility level"
do
before
{
allow
(
current_application_settings
).
to
receive
(
:restricted_visibility_levels
).
and_return
([
Gitlab
::
VisibilityLevel
::
PUBLIC
])
}
before
{
allow
(
current_application_settings
).
to
receive
(
:restricted_visibility_levels
).
and_return
([
Gitlab
::
VisibilityLevel
::
PUBLIC
])
}
it
{
is_expected
.
to_not
be_persisted
}
it
{
is_expected
.
not_to
be_persisted
}
end
end
end
end
end
end
spec/services/issues/create_service_spec.rb
View file @
75739e54
...
@@ -55,7 +55,7 @@ describe Issues::CreateService, services: true do
...
@@ -55,7 +55,7 @@ describe Issues::CreateService, services: true do
end
end
it
'does not assign label'
do
it
'does not assign label'
do
expect
(
issue
.
labels
).
to_not
include
label
expect
(
issue
.
labels
).
not_to
include
label
end
end
end
end
...
@@ -69,7 +69,7 @@ describe Issues::CreateService, services: true do
...
@@ -69,7 +69,7 @@ describe Issues::CreateService, services: true do
end
end
it
'does not assign milestone'
do
it
'does not assign milestone'
do
expect
(
issue
.
milestone
).
to_not
eq
milestone
expect
(
issue
.
milestone
).
not_to
eq
milestone
end
end
end
end
end
end
...
...
spec/services/issues/move_service_spec.rb
View file @
75739e54
...
@@ -194,10 +194,10 @@ describe Issues::MoveService, services: true do
...
@@ -194,10 +194,10 @@ describe Issues::MoveService, services: true do
include_context
'issue move executed'
include_context
'issue move executed'
it
'rewrites uploads in description'
do
it
'rewrites uploads in description'
do
expect
(
new_issue
.
description
).
to_not
eq
description
expect
(
new_issue
.
description
).
not_to
eq
description
expect
(
new_issue
.
description
)
expect
(
new_issue
.
description
)
.
to
match
(
/Text and
#{
FileUploader
::
MARKDOWN_PATTERN
}
/
)
.
to
match
(
/Text and
#{
FileUploader
::
MARKDOWN_PATTERN
}
/
)
expect
(
new_issue
.
description
).
to_not
include
uploader
.
secret
expect
(
new_issue
.
description
).
not_to
include
uploader
.
secret
end
end
end
end
end
end
...
@@ -231,7 +231,7 @@ describe Issues::MoveService, services: true do
...
@@ -231,7 +231,7 @@ describe Issues::MoveService, services: true do
context
'user is reporter in both projects'
do
context
'user is reporter in both projects'
do
include_context
'user can move issue'
include_context
'user can move issue'
it
{
expect
{
move
}.
to_not
raise_error
}
it
{
expect
{
move
}.
not_to
raise_error
}
end
end
context
'user is reporter only in new project'
do
context
'user is reporter only in new project'
do
...
...
spec/services/merge_requests/merge_when_build_succeeds_service_spec.rb
View file @
75739e54
...
@@ -75,7 +75,7 @@ describe MergeRequests::MergeWhenBuildSucceedsService do
...
@@ -75,7 +75,7 @@ describe MergeRequests::MergeWhenBuildSucceedsService do
allow
(
ci_commit
).
to
receive
(
:success?
).
and_return
(
true
)
allow
(
ci_commit
).
to
receive
(
:success?
).
and_return
(
true
)
allow
(
old_build
).
to
receive
(
:sha
).
and_return
(
'1234abcdef'
)
allow
(
old_build
).
to
receive
(
:sha
).
and_return
(
'1234abcdef'
)
expect
(
MergeWorker
).
to_not
receive
(
:perform_async
)
expect
(
MergeWorker
).
not_to
receive
(
:perform_async
)
service
.
trigger
(
old_build
)
service
.
trigger
(
old_build
)
end
end
end
end
...
@@ -88,7 +88,7 @@ describe MergeRequests::MergeWhenBuildSucceedsService do
...
@@ -88,7 +88,7 @@ describe MergeRequests::MergeWhenBuildSucceedsService do
it
"doesn't merge a requests for status on other branch"
do
it
"doesn't merge a requests for status on other branch"
do
allow
(
project
.
repository
).
to
receive
(
:branch_names_contains
).
with
(
commit_status
.
sha
).
and_return
([])
allow
(
project
.
repository
).
to
receive
(
:branch_names_contains
).
with
(
commit_status
.
sha
).
and_return
([])
expect
(
MergeWorker
).
to_not
receive
(
:perform_async
)
expect
(
MergeWorker
).
not_to
receive
(
:perform_async
)
service
.
trigger
(
commit_status
)
service
.
trigger
(
commit_status
)
end
end
...
@@ -122,7 +122,7 @@ describe MergeRequests::MergeWhenBuildSucceedsService do
...
@@ -122,7 +122,7 @@ describe MergeRequests::MergeWhenBuildSucceedsService do
end
end
it
"doesn't merge if some stages failed"
do
it
"doesn't merge if some stages failed"
do
expect
(
MergeWorker
).
to_not
receive
(
:perform_async
)
expect
(
MergeWorker
).
not_to
receive
(
:perform_async
)
build
.
success
build
.
success
test
.
drop
test
.
drop
end
end
...
...
spec/workers/post_receive_spec.rb
View file @
75739e54
...
@@ -61,7 +61,7 @@ describe PostReceive do
...
@@ -61,7 +61,7 @@ describe PostReceive do
context
"does not create a Ci::Commit"
do
context
"does not create a Ci::Commit"
do
before
{
stub_ci_commit_yaml_file
(
nil
)
}
before
{
stub_ci_commit_yaml_file
(
nil
)
}
it
{
expect
{
subject
}.
to_not
change
{
Ci
::
Commit
.
count
}
}
it
{
expect
{
subject
}.
not_to
change
{
Ci
::
Commit
.
count
}
}
end
end
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