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
Jérome Perrin
gitlab-ce
Commits
c8b80247
Commit
c8b80247
authored
Aug 10, 2017
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable the RSpec/HookArgument cop and auto-correct offenses
parent
4ef10795
Changes
58
Hide whitespace changes
Inline
Side-by-side
Showing
58 changed files
with
85 additions
and
86 deletions
+85
-86
.rubocop.yml
.rubocop.yml
+5
-0
.rubocop_todo.yml
.rubocop_todo.yml
+0
-6
spec/config/mail_room_spec.rb
spec/config/mail_room_spec.rb
+2
-2
spec/controllers/autocomplete_controller_spec.rb
spec/controllers/autocomplete_controller_spec.rb
+1
-1
spec/controllers/registrations_controller_spec.rb
spec/controllers/registrations_controller_spec.rb
+1
-1
spec/features/groups/group_settings_spec.rb
spec/features/groups/group_settings_spec.rb
+1
-1
spec/features/merge_requests/diffs_spec.rb
spec/features/merge_requests/diffs_spec.rb
+1
-1
spec/features/merge_requests/discussion_spec.rb
spec/features/merge_requests/discussion_spec.rb
+2
-2
spec/features/merge_requests/user_posts_diff_notes_spec.rb
spec/features/merge_requests/user_posts_diff_notes_spec.rb
+2
-2
spec/features/profiles/account_spec.rb
spec/features/profiles/account_spec.rb
+1
-1
spec/features/projects/import_export/import_file_spec.rb
spec/features/projects/import_export/import_file_spec.rb
+1
-1
spec/features/projects/project_settings_spec.rb
spec/features/projects/project_settings_spec.rb
+3
-3
spec/features/triggers_spec.rb
spec/features/triggers_spec.rb
+2
-2
spec/features/users_spec.rb
spec/features/users_spec.rb
+1
-1
spec/javascripts/fixtures/abuse_reports.rb
spec/javascripts/fixtures/abuse_reports.rb
+1
-1
spec/javascripts/fixtures/blob.rb
spec/javascripts/fixtures/blob.rb
+1
-1
spec/javascripts/fixtures/boards.rb
spec/javascripts/fixtures/boards.rb
+1
-1
spec/javascripts/fixtures/branches.rb
spec/javascripts/fixtures/branches.rb
+1
-1
spec/javascripts/fixtures/dashboard.rb
spec/javascripts/fixtures/dashboard.rb
+1
-1
spec/javascripts/fixtures/deploy_keys.rb
spec/javascripts/fixtures/deploy_keys.rb
+1
-1
spec/javascripts/fixtures/environments.rb
spec/javascripts/fixtures/environments.rb
+1
-1
spec/javascripts/fixtures/issues.rb
spec/javascripts/fixtures/issues.rb
+1
-1
spec/javascripts/fixtures/jobs.rb
spec/javascripts/fixtures/jobs.rb
+1
-1
spec/javascripts/fixtures/labels.rb
spec/javascripts/fixtures/labels.rb
+2
-2
spec/javascripts/fixtures/merge_requests.rb
spec/javascripts/fixtures/merge_requests.rb
+1
-1
spec/javascripts/fixtures/merge_requests_diffs.rb
spec/javascripts/fixtures/merge_requests_diffs.rb
+1
-1
spec/javascripts/fixtures/pipelines.rb
spec/javascripts/fixtures/pipelines.rb
+1
-1
spec/javascripts/fixtures/projects.rb
spec/javascripts/fixtures/projects.rb
+1
-1
spec/javascripts/fixtures/prometheus_service.rb
spec/javascripts/fixtures/prometheus_service.rb
+1
-1
spec/javascripts/fixtures/services.rb
spec/javascripts/fixtures/services.rb
+1
-1
spec/javascripts/fixtures/snippet.rb
spec/javascripts/fixtures/snippet.rb
+1
-1
spec/javascripts/fixtures/todos.rb
spec/javascripts/fixtures/todos.rb
+2
-2
spec/lib/gitlab/daemon_spec.rb
spec/lib/gitlab/daemon_spec.rb
+1
-1
spec/lib/gitlab/data_builder/note_spec.rb
spec/lib/gitlab/data_builder/note_spec.rb
+1
-1
spec/lib/gitlab/git/diff_collection_spec.rb
spec/lib/gitlab/git/diff_collection_spec.rb
+3
-3
spec/lib/gitlab/git/repository_spec.rb
spec/lib/gitlab/git/repository_spec.rb
+8
-8
spec/lib/gitlab/git/storage/circuit_breaker_spec.rb
spec/lib/gitlab/git/storage/circuit_breaker_spec.rb
+1
-1
spec/lib/gitlab/health_checks/fs_shards_check_spec.rb
spec/lib/gitlab/health_checks/fs_shards_check_spec.rb
+1
-1
spec/lib/gitlab/request_context_spec.rb
spec/lib/gitlab/request_context_spec.rb
+1
-1
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+3
-3
spec/models/concerns/issuable_spec.rb
spec/models/concerns/issuable_spec.rb
+2
-2
spec/models/concerns/reactive_caching_spec.rb
spec/models/concerns/reactive_caching_spec.rb
+1
-1
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+1
-1
spec/models/project_services/drone_ci_service_spec.rb
spec/models/project_services/drone_ci_service_spec.rb
+1
-1
spec/models/project_services/hipchat_service_spec.rb
spec/models/project_services/hipchat_service_spec.rb
+1
-1
spec/models/project_spec.rb
spec/models/project_spec.rb
+1
-1
spec/requests/api/groups_spec.rb
spec/requests/api/groups_spec.rb
+1
-1
spec/requests/api/merge_requests_spec.rb
spec/requests/api/merge_requests_spec.rb
+1
-1
spec/requests/api/v3/groups_spec.rb
spec/requests/api/v3/groups_spec.rb
+1
-1
spec/requests/api/v3/merge_requests_spec.rb
spec/requests/api/v3/merge_requests_spec.rb
+1
-1
spec/services/labels/update_service_spec.rb
spec/services/labels/update_service_spec.rb
+1
-1
spec/services/notification_service_spec.rb
spec/services/notification_service_spec.rb
+3
-3
spec/services/projects/housekeeping_service_spec.rb
spec/services/projects/housekeeping_service_spec.rb
+1
-1
spec/services/web_hook_service_spec.rb
spec/services/web_hook_service_spec.rb
+1
-1
spec/support/redis/redis_shared_examples.rb
spec/support/redis/redis_shared_examples.rb
+2
-2
spec/support/unique_ip_check_shared_examples.rb
spec/support/unique_ip_check_shared_examples.rb
+1
-1
spec/tasks/config_lint_spec.rb
spec/tasks/config_lint_spec.rb
+1
-1
spec/tasks/gitlab/backup_rake_spec.rb
spec/tasks/gitlab/backup_rake_spec.rb
+2
-2
No files found.
.rubocop.yml
View file @
c8b80247
...
@@ -1099,6 +1099,11 @@ RSpec/FilePath:
...
@@ -1099,6 +1099,11 @@ RSpec/FilePath:
RSpec/Focus
:
RSpec/Focus
:
Enabled
:
true
Enabled
:
true
# Checks the arguments passed to `before`, `around`, and `after`.
RSpec/HookArgument
:
Enabled
:
true
EnforcedStyle
:
implicit
# Configuration parameters: EnforcedStyle, SupportedStyles.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: is_expected, should
# SupportedStyles: is_expected, should
RSpec/ImplicitExpect
:
RSpec/ImplicitExpect
:
...
...
.rubocop_todo.yml
View file @
c8b80247
...
@@ -70,12 +70,6 @@ RSpec/EmptyLineAfterFinalLet:
...
@@ -70,12 +70,6 @@ RSpec/EmptyLineAfterFinalLet:
RSpec/EmptyLineAfterSubject
:
RSpec/EmptyLineAfterSubject
:
Enabled
:
false
Enabled
:
false
# Offense count: 78
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: implicit, each, example
RSpec/HookArgument
:
Enabled
:
false
# Offense count: 9
# Offense count: 9
# 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/config/mail_room_spec.rb
View file @
c8b80247
...
@@ -20,12 +20,12 @@ describe 'mail_room.yml' do
...
@@ -20,12 +20,12 @@ describe 'mail_room.yml' do
YAML
.
load
(
output
)
YAML
.
load
(
output
)
end
end
before
(
:each
)
do
before
do
stub_env
(
'GITLAB_REDIS_QUEUES_CONFIG_FILE'
,
absolute_path
(
queues_config_path
))
stub_env
(
'GITLAB_REDIS_QUEUES_CONFIG_FILE'
,
absolute_path
(
queues_config_path
))
clear_queues_raw_config
clear_queues_raw_config
end
end
after
(
:each
)
do
after
do
clear_queues_raw_config
clear_queues_raw_config
end
end
...
...
spec/controllers/autocomplete_controller_spec.rb
View file @
c8b80247
...
@@ -320,7 +320,7 @@ describe AutocompleteController do
...
@@ -320,7 +320,7 @@ describe AutocompleteController do
end
end
context
'authorized projects without admin_issue ability'
do
context
'authorized projects without admin_issue ability'
do
before
(
:each
)
do
before
do
authorized_project
.
add_guest
(
user
)
authorized_project
.
add_guest
(
user
)
expect
(
user
.
can?
(
:admin_issue
,
authorized_project
)).
to
eq
(
false
)
expect
(
user
.
can?
(
:admin_issue
,
authorized_project
)).
to
eq
(
false
)
...
...
spec/controllers/registrations_controller_spec.rb
View file @
c8b80247
...
@@ -5,7 +5,7 @@ describe RegistrationsController do
...
@@ -5,7 +5,7 @@ describe RegistrationsController do
let
(
:user_params
)
{
{
user:
{
name:
'new_user'
,
username:
'new_username'
,
email:
'new@user.com'
,
password:
'Any_password'
}
}
}
let
(
:user_params
)
{
{
user:
{
name:
'new_user'
,
username:
'new_username'
,
email:
'new@user.com'
,
password:
'Any_password'
}
}
}
context
'email confirmation'
do
context
'email confirmation'
do
around
(
:each
)
do
|
example
|
around
do
|
example
|
perform_enqueued_jobs
do
perform_enqueued_jobs
do
example
.
run
example
.
run
end
end
...
...
spec/features/groups/group_settings_spec.rb
View file @
c8b80247
...
@@ -57,7 +57,7 @@ feature 'Edit group settings' do
...
@@ -57,7 +57,7 @@ feature 'Edit group settings' do
TestEnv
.
clean_test_path
TestEnv
.
clean_test_path
end
end
after
(
:example
)
do
after
do
TestEnv
.
clean_test_path
TestEnv
.
clean_test_path
end
end
...
...
spec/features/merge_requests/diffs_spec.rb
View file @
c8b80247
...
@@ -5,7 +5,7 @@ feature 'Diffs URL', js: true do
...
@@ -5,7 +5,7 @@ feature 'Diffs URL', js: true do
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
context
'when visit with */* as accept header'
do
context
'when visit with */* as accept header'
do
before
(
:each
)
do
before
do
page
.
driver
.
add_header
(
'Accept'
,
'*/*'
)
page
.
driver
.
add_header
(
'Accept'
,
'*/*'
)
end
end
...
...
spec/features/merge_requests/discussion_spec.rb
View file @
c8b80247
...
@@ -26,7 +26,7 @@ feature 'Merge Request Discussions' do
...
@@ -26,7 +26,7 @@ feature 'Merge Request Discussions' do
let
(
:outdated_diff_refs
)
{
project
.
commit
(
"874797c3a73b60d2187ed6e2fcabd289ff75171e"
).
diff_refs
}
let
(
:outdated_diff_refs
)
{
project
.
commit
(
"874797c3a73b60d2187ed6e2fcabd289ff75171e"
).
diff_refs
}
before
(
:each
)
do
before
do
visit
project_merge_request_path
(
project
,
merge_request
)
visit
project_merge_request_path
(
project
,
merge_request
)
end
end
...
@@ -71,7 +71,7 @@ feature 'Merge Request Discussions' do
...
@@ -71,7 +71,7 @@ feature 'Merge Request Discussions' do
end
end
end
end
before
(
:each
)
do
before
do
visit
project_merge_request_path
(
project
,
merge_request
)
visit
project_merge_request_path
(
project
,
merge_request
)
end
end
...
...
spec/features/merge_requests/user_posts_diff_notes_spec.rb
View file @
c8b80247
...
@@ -71,7 +71,7 @@ feature 'Merge requests > User posts diff notes', :js do
...
@@ -71,7 +71,7 @@ feature 'Merge requests > User posts diff notes', :js do
end
end
context
'with an unfolded line'
do
context
'with an unfolded line'
do
before
(
:each
)
do
before
do
find
(
'.js-unfold'
,
match: :first
).
click
find
(
'.js-unfold'
,
match: :first
).
click
wait_for_requests
wait_for_requests
end
end
...
@@ -120,7 +120,7 @@ feature 'Merge requests > User posts diff notes', :js do
...
@@ -120,7 +120,7 @@ feature 'Merge requests > User posts diff notes', :js do
end
end
context
'with an unfolded line'
do
context
'with an unfolded line'
do
before
(
:each
)
do
before
do
find
(
'.js-unfold'
,
match: :first
).
click
find
(
'.js-unfold'
,
match: :first
).
click
wait_for_requests
wait_for_requests
end
end
...
...
spec/features/profiles/account_spec.rb
View file @
c8b80247
...
@@ -35,7 +35,7 @@ feature 'Profile > Account' do
...
@@ -35,7 +35,7 @@ feature 'Profile > Account' do
TestEnv
.
clean_test_path
TestEnv
.
clean_test_path
end
end
after
(
:example
)
do
after
do
TestEnv
.
clean_test_path
TestEnv
.
clean_test_path
end
end
...
...
spec/features/projects/import_export/import_file_spec.rb
View file @
c8b80247
...
@@ -10,7 +10,7 @@ feature 'Import/Export - project import integration test', js: true do
...
@@ -10,7 +10,7 @@ feature 'Import/Export - project import integration test', js: true do
allow_any_instance_of
(
Gitlab
::
ImportExport
).
to
receive
(
:storage_path
).
and_return
(
export_path
)
allow_any_instance_of
(
Gitlab
::
ImportExport
).
to
receive
(
:storage_path
).
and_return
(
export_path
)
end
end
after
(
:each
)
do
after
do
FileUtils
.
rm_rf
(
export_path
,
secure:
true
)
FileUtils
.
rm_rf
(
export_path
,
secure:
true
)
end
end
...
...
spec/features/projects/project_settings_spec.rb
View file @
c8b80247
...
@@ -65,7 +65,7 @@ describe 'Edit Project Settings' do
...
@@ -65,7 +65,7 @@ describe 'Edit Project Settings' do
TestEnv
.
clean_test_path
TestEnv
.
clean_test_path
end
end
after
(
:example
)
do
after
do
TestEnv
.
clean_test_path
TestEnv
.
clean_test_path
end
end
...
@@ -107,11 +107,11 @@ describe 'Edit Project Settings' do
...
@@ -107,11 +107,11 @@ describe 'Edit Project Settings' do
TestEnv
.
clean_test_path
TestEnv
.
clean_test_path
end
end
before
(
:example
)
do
before
do
group
.
add_owner
(
user
)
group
.
add_owner
(
user
)
end
end
after
(
:example
)
do
after
do
TestEnv
.
clean_test_path
TestEnv
.
clean_test_path
end
end
...
...
spec/features/triggers_spec.rb
View file @
c8b80247
...
@@ -82,7 +82,7 @@ feature 'Triggers', js: true do
...
@@ -82,7 +82,7 @@ feature 'Triggers', js: true do
end
end
describe
'trigger "Take ownership" workflow'
do
describe
'trigger "Take ownership" workflow'
do
before
(
:each
)
do
before
do
create
(
:ci_trigger
,
owner:
user2
,
project:
@project
,
description:
trigger_title
)
create
(
:ci_trigger
,
owner:
user2
,
project:
@project
,
description:
trigger_title
)
visit
project_settings_ci_cd_path
(
@project
)
visit
project_settings_ci_cd_path
(
@project
)
end
end
...
@@ -104,7 +104,7 @@ feature 'Triggers', js: true do
...
@@ -104,7 +104,7 @@ feature 'Triggers', js: true do
end
end
describe
'trigger "Revoke" workflow'
do
describe
'trigger "Revoke" workflow'
do
before
(
:each
)
do
before
do
create
(
:ci_trigger
,
owner:
user2
,
project:
@project
,
description:
trigger_title
)
create
(
:ci_trigger
,
owner:
user2
,
project:
@project
,
description:
trigger_title
)
visit
project_settings_ci_cd_path
(
@project
)
visit
project_settings_ci_cd_path
(
@project
)
end
end
...
...
spec/features/users_spec.rb
View file @
c8b80247
...
@@ -73,7 +73,7 @@ feature 'Users', js: true do
...
@@ -73,7 +73,7 @@ feature 'Users', js: true do
let
(
:loading_icon
)
{
'.fa.fa-spinner'
}
let
(
:loading_icon
)
{
'.fa.fa-spinner'
}
let
(
:username_input
)
{
'new_user_username'
}
let
(
:username_input
)
{
'new_user_username'
}
before
(
:each
)
do
before
do
visit
new_user_session_path
visit
new_user_session_path
click_link
'Register'
click_link
'Register'
end
end
...
...
spec/javascripts/fixtures/abuse_reports.rb
View file @
c8b80247
...
@@ -14,7 +14,7 @@ describe Admin::AbuseReportsController, '(JavaScript fixtures)', type: :controll
...
@@ -14,7 +14,7 @@ describe Admin::AbuseReportsController, '(JavaScript fixtures)', type: :controll
clean_frontend_fixtures
(
'abuse_reports/'
)
clean_frontend_fixtures
(
'abuse_reports/'
)
end
end
before
(
:each
)
do
before
do
sign_in
(
admin
)
sign_in
(
admin
)
end
end
...
...
spec/javascripts/fixtures/blob.rb
View file @
c8b80247
...
@@ -13,7 +13,7 @@ describe Projects::BlobController, '(JavaScript fixtures)', type: :controller do
...
@@ -13,7 +13,7 @@ describe Projects::BlobController, '(JavaScript fixtures)', type: :controller do
clean_frontend_fixtures
(
'blob/'
)
clean_frontend_fixtures
(
'blob/'
)
end
end
before
(
:each
)
do
before
do
sign_in
(
admin
)
sign_in
(
admin
)
end
end
...
...
spec/javascripts/fixtures/boards.rb
View file @
c8b80247
...
@@ -13,7 +13,7 @@ describe Projects::BoardsController, '(JavaScript fixtures)', type: :controller
...
@@ -13,7 +13,7 @@ describe Projects::BoardsController, '(JavaScript fixtures)', type: :controller
clean_frontend_fixtures
(
'boards/'
)
clean_frontend_fixtures
(
'boards/'
)
end
end
before
(
:each
)
do
before
do
sign_in
(
admin
)
sign_in
(
admin
)
end
end
...
...
spec/javascripts/fixtures/branches.rb
View file @
c8b80247
...
@@ -13,7 +13,7 @@ describe Projects::BranchesController, '(JavaScript fixtures)', type: :controlle
...
@@ -13,7 +13,7 @@ describe Projects::BranchesController, '(JavaScript fixtures)', type: :controlle
clean_frontend_fixtures
(
'branches/'
)
clean_frontend_fixtures
(
'branches/'
)
end
end
before
(
:each
)
do
before
do
sign_in
(
admin
)
sign_in
(
admin
)
end
end
...
...
spec/javascripts/fixtures/dashboard.rb
View file @
c8b80247
...
@@ -13,7 +13,7 @@ describe Dashboard::ProjectsController, '(JavaScript fixtures)', type: :controll
...
@@ -13,7 +13,7 @@ describe Dashboard::ProjectsController, '(JavaScript fixtures)', type: :controll
clean_frontend_fixtures
(
'dashboard/'
)
clean_frontend_fixtures
(
'dashboard/'
)
end
end
before
(
:each
)
do
before
do
sign_in
(
admin
)
sign_in
(
admin
)
end
end
...
...
spec/javascripts/fixtures/deploy_keys.rb
View file @
c8b80247
...
@@ -12,7 +12,7 @@ describe Projects::DeployKeysController, '(JavaScript fixtures)', type: :control
...
@@ -12,7 +12,7 @@ describe Projects::DeployKeysController, '(JavaScript fixtures)', type: :control
clean_frontend_fixtures
(
'deploy_keys/'
)
clean_frontend_fixtures
(
'deploy_keys/'
)
end
end
before
(
:each
)
do
before
do
sign_in
(
admin
)
sign_in
(
admin
)
end
end
...
...
spec/javascripts/fixtures/environments.rb
View file @
c8b80247
...
@@ -14,7 +14,7 @@ describe Projects::EnvironmentsController, '(JavaScript fixtures)', type: :contr
...
@@ -14,7 +14,7 @@ describe Projects::EnvironmentsController, '(JavaScript fixtures)', type: :contr
clean_frontend_fixtures
(
'environments/metrics'
)
clean_frontend_fixtures
(
'environments/metrics'
)
end
end
before
(
:each
)
do
before
do
sign_in
(
admin
)
sign_in
(
admin
)
end
end
...
...
spec/javascripts/fixtures/issues.rb
View file @
c8b80247
...
@@ -13,7 +13,7 @@ describe Projects::IssuesController, '(JavaScript fixtures)', type: :controller
...
@@ -13,7 +13,7 @@ describe Projects::IssuesController, '(JavaScript fixtures)', type: :controller
clean_frontend_fixtures
(
'issues/'
)
clean_frontend_fixtures
(
'issues/'
)
end
end
before
(
:each
)
do
before
do
sign_in
(
admin
)
sign_in
(
admin
)
end
end
...
...
spec/javascripts/fixtures/jobs.rb
View file @
c8b80247
...
@@ -17,7 +17,7 @@ describe Projects::JobsController, '(JavaScript fixtures)', type: :controller do
...
@@ -17,7 +17,7 @@ describe Projects::JobsController, '(JavaScript fixtures)', type: :controller do
clean_frontend_fixtures
(
'builds/'
)
clean_frontend_fixtures
(
'builds/'
)
end
end
before
(
:each
)
do
before
do
sign_in
(
admin
)
sign_in
(
admin
)
end
end
...
...
spec/javascripts/fixtures/labels.rb
View file @
c8b80247
...
@@ -22,7 +22,7 @@ describe 'Labels (JavaScript fixtures)' do
...
@@ -22,7 +22,7 @@ describe 'Labels (JavaScript fixtures)' do
describe
Groups
::
LabelsController
,
'(JavaScript fixtures)'
,
type: :controller
do
describe
Groups
::
LabelsController
,
'(JavaScript fixtures)'
,
type: :controller
do
render_views
render_views
before
(
:each
)
do
before
do
sign_in
(
admin
)
sign_in
(
admin
)
end
end
...
@@ -39,7 +39,7 @@ describe 'Labels (JavaScript fixtures)' do
...
@@ -39,7 +39,7 @@ describe 'Labels (JavaScript fixtures)' do
describe
Projects
::
LabelsController
,
'(JavaScript fixtures)'
,
type: :controller
do
describe
Projects
::
LabelsController
,
'(JavaScript fixtures)'
,
type: :controller
do
render_views
render_views
before
(
:each
)
do
before
do
sign_in
(
admin
)
sign_in
(
admin
)
end
end
...
...
spec/javascripts/fixtures/merge_requests.rb
View file @
c8b80247
...
@@ -33,7 +33,7 @@ describe Projects::MergeRequestsController, '(JavaScript fixtures)', type: :cont
...
@@ -33,7 +33,7 @@ describe Projects::MergeRequestsController, '(JavaScript fixtures)', type: :cont
clean_frontend_fixtures
(
'merge_requests/'
)
clean_frontend_fixtures
(
'merge_requests/'
)
end
end
before
(
:each
)
do
before
do
sign_in
(
admin
)
sign_in
(
admin
)
end
end
...
...
spec/javascripts/fixtures/merge_requests_diffs.rb
View file @
c8b80247
...
@@ -25,7 +25,7 @@ describe Projects::MergeRequests::DiffsController, '(JavaScript fixtures)', type
...
@@ -25,7 +25,7 @@ describe Projects::MergeRequests::DiffsController, '(JavaScript fixtures)', type
clean_frontend_fixtures
(
'merge_request_diffs/'
)
clean_frontend_fixtures
(
'merge_request_diffs/'
)
end
end
before
(
:each
)
do
before
do
sign_in
(
admin
)
sign_in
(
admin
)
end
end
...
...
spec/javascripts/fixtures/pipelines.rb
View file @
c8b80247
...
@@ -19,7 +19,7 @@ describe Projects::PipelinesController, '(JavaScript fixtures)', type: :controll
...
@@ -19,7 +19,7 @@ describe Projects::PipelinesController, '(JavaScript fixtures)', type: :controll
clean_frontend_fixtures
(
'pipelines/'
)
clean_frontend_fixtures
(
'pipelines/'
)
end
end
before
(
:each
)
do
before
do
sign_in
(
admin
)
sign_in
(
admin
)
end
end
...
...
spec/javascripts/fixtures/projects.rb
View file @
c8b80247
...
@@ -13,7 +13,7 @@ describe ProjectsController, '(JavaScript fixtures)', type: :controller do
...
@@ -13,7 +13,7 @@ describe ProjectsController, '(JavaScript fixtures)', type: :controller do
clean_frontend_fixtures
(
'projects/'
)
clean_frontend_fixtures
(
'projects/'
)
end
end
before
(
:each
)
do
before
do
sign_in
(
admin
)
sign_in
(
admin
)
end
end
...
...
spec/javascripts/fixtures/prometheus_service.rb
View file @
c8b80247
...
@@ -14,7 +14,7 @@ describe Projects::ServicesController, '(JavaScript fixtures)', type: :controlle
...
@@ -14,7 +14,7 @@ describe Projects::ServicesController, '(JavaScript fixtures)', type: :controlle
clean_frontend_fixtures
(
'services/prometheus'
)
clean_frontend_fixtures
(
'services/prometheus'
)
end
end
before
(
:each
)
do
before
do
sign_in
(
admin
)
sign_in
(
admin
)
end
end
...
...
spec/javascripts/fixtures/services.rb
View file @
c8b80247
...
@@ -15,7 +15,7 @@ describe Projects::ServicesController, '(JavaScript fixtures)', type: :controlle
...
@@ -15,7 +15,7 @@ describe Projects::ServicesController, '(JavaScript fixtures)', type: :controlle
clean_frontend_fixtures
(
'services/'
)
clean_frontend_fixtures
(
'services/'
)
end
end
before
(
:each
)
do
before
do
sign_in
(
admin
)
sign_in
(
admin
)
end
end
...
...
spec/javascripts/fixtures/snippet.rb
View file @
c8b80247
...
@@ -14,7 +14,7 @@ describe SnippetsController, '(JavaScript fixtures)', type: :controller do
...
@@ -14,7 +14,7 @@ describe SnippetsController, '(JavaScript fixtures)', type: :controller do
clean_frontend_fixtures
(
'snippets/'
)
clean_frontend_fixtures
(
'snippets/'
)
end
end
before
(
:each
)
do
before
do
sign_in
(
admin
)
sign_in
(
admin
)
end
end
...
...
spec/javascripts/fixtures/todos.rb
View file @
c8b80247
...
@@ -18,7 +18,7 @@ describe 'Todos (JavaScript fixtures)' do
...
@@ -18,7 +18,7 @@ describe 'Todos (JavaScript fixtures)' do
describe
Dashboard
::
TodosController
,
'(JavaScript fixtures)'
,
type: :controller
do
describe
Dashboard
::
TodosController
,
'(JavaScript fixtures)'
,
type: :controller
do
render_views
render_views
before
(
:each
)
do
before
do
sign_in
(
admin
)
sign_in
(
admin
)
end
end
...
@@ -33,7 +33,7 @@ describe 'Todos (JavaScript fixtures)' do
...
@@ -33,7 +33,7 @@ describe 'Todos (JavaScript fixtures)' do
describe
Projects
::
TodosController
,
'(JavaScript fixtures)'
,
type: :controller
do
describe
Projects
::
TodosController
,
'(JavaScript fixtures)'
,
type: :controller
do
render_views
render_views
before
(
:each
)
do
before
do
sign_in
(
admin
)
sign_in
(
admin
)
end
end
...
...
spec/lib/gitlab/daemon_spec.rb
View file @
c8b80247
...
@@ -13,7 +13,7 @@ describe Gitlab::Daemon do
...
@@ -13,7 +13,7 @@ describe Gitlab::Daemon do
allow
(
Kernel
).
to
receive
(
:at_exit
)
allow
(
Kernel
).
to
receive
(
:at_exit
)
end
end
after
(
:each
)
do
after
do
described_class
.
instance_variable_set
(
:@instance
,
nil
)
described_class
.
instance_variable_set
(
:@instance
,
nil
)
end
end
...
...
spec/lib/gitlab/data_builder/note_spec.rb
View file @
c8b80247
...
@@ -6,7 +6,7 @@ describe Gitlab::DataBuilder::Note do
...
@@ -6,7 +6,7 @@ describe Gitlab::DataBuilder::Note do
let
(
:data
)
{
described_class
.
build
(
note
,
user
)
}
let
(
:data
)
{
described_class
.
build
(
note
,
user
)
}
let
(
:fixed_time
)
{
Time
.
at
(
1425600000
)
}
# Avoid time precision errors
let
(
:fixed_time
)
{
Time
.
at
(
1425600000
)
}
# Avoid time precision errors
before
(
:each
)
do
before
do
expect
(
data
).
to
have_key
(
:object_attributes
)
expect
(
data
).
to
have_key
(
:object_attributes
)
expect
(
data
[
:object_attributes
]).
to
have_key
(
:url
)
expect
(
data
[
:object_attributes
]).
to
have_key
(
:url
)
expect
(
data
[
:object_attributes
][
:url
])
expect
(
data
[
:object_attributes
][
:url
])
...
...
spec/lib/gitlab/git/diff_collection_spec.rb
View file @
c8b80247
...
@@ -384,7 +384,7 @@ describe Gitlab::Git::DiffCollection, seed_helper: true do
...
@@ -384,7 +384,7 @@ describe Gitlab::Git::DiffCollection, seed_helper: true do
context
'when go over safe limits on files'
do
context
'when go over safe limits on files'
do
let
(
:iterator
)
{
[
fake_diff
(
1
,
1
)]
*
4
}
let
(
:iterator
)
{
[
fake_diff
(
1
,
1
)]
*
4
}
before
(
:each
)
do
before
do
stub_const
(
'Gitlab::Git::DiffCollection::DEFAULT_LIMITS'
,
{
max_files:
2
,
max_lines:
max_lines
})
stub_const
(
'Gitlab::Git::DiffCollection::DEFAULT_LIMITS'
,
{
max_files:
2
,
max_lines:
max_lines
})
end
end
...
@@ -409,7 +409,7 @@ describe Gitlab::Git::DiffCollection, seed_helper: true do
...
@@ -409,7 +409,7 @@ describe Gitlab::Git::DiffCollection, seed_helper: true do
]
]
end
end
before
(
:each
)
do
before
do
stub_const
(
'Gitlab::Git::DiffCollection::DEFAULT_LIMITS'
,
{
max_files:
max_files
,
max_lines:
80
})
stub_const
(
'Gitlab::Git::DiffCollection::DEFAULT_LIMITS'
,
{
max_files:
max_files
,
max_lines:
80
})
end
end
...
@@ -434,7 +434,7 @@ describe Gitlab::Git::DiffCollection, seed_helper: true do
...
@@ -434,7 +434,7 @@ describe Gitlab::Git::DiffCollection, seed_helper: true do
]
]
end
end
before
(
:each
)
do
before
do
stub_const
(
'Gitlab::Git::DiffCollection::DEFAULT_LIMITS'
,
{
max_files:
max_files
,
max_lines:
80
})
stub_const
(
'Gitlab::Git::DiffCollection::DEFAULT_LIMITS'
,
{
max_files:
max_files
,
max_lines:
80
})
end
end
...
...
spec/lib/gitlab/git/repository_spec.rb
View file @
c8b80247
...
@@ -1023,7 +1023,7 @@ describe Gitlab::Git::Repository, seed_helper: true do
...
@@ -1023,7 +1023,7 @@ describe Gitlab::Git::Repository, seed_helper: true do
end
end
context
"with no .gitattrbutes"
do
context
"with no .gitattrbutes"
do
before
(
:each
)
do
before
do
repository
.
copy_gitattributes
(
"master"
)
repository
.
copy_gitattributes
(
"master"
)
end
end
...
@@ -1031,13 +1031,13 @@ describe Gitlab::Git::Repository, seed_helper: true do
...
@@ -1031,13 +1031,13 @@ describe Gitlab::Git::Repository, seed_helper: true do
expect
(
File
.
exist?
(
attributes_path
)).
to
be_falsey
expect
(
File
.
exist?
(
attributes_path
)).
to
be_falsey
end
end
after
(
:each
)
do
after
do
FileUtils
.
rm_rf
(
attributes_path
)
FileUtils
.
rm_rf
(
attributes_path
)
end
end
end
end
context
"with .gitattrbutes"
do
context
"with .gitattrbutes"
do
before
(
:each
)
do
before
do
repository
.
copy_gitattributes
(
"gitattributes"
)
repository
.
copy_gitattributes
(
"gitattributes"
)
end
end
...
@@ -1050,13 +1050,13 @@ describe Gitlab::Git::Repository, seed_helper: true do
...
@@ -1050,13 +1050,13 @@ describe Gitlab::Git::Repository, seed_helper: true do
expect
(
contents
).
to
eq
(
"*.md binary
\n
"
)
expect
(
contents
).
to
eq
(
"*.md binary
\n
"
)
end
end
after
(
:each
)
do
after
do
FileUtils
.
rm_rf
(
attributes_path
)
FileUtils
.
rm_rf
(
attributes_path
)
end
end
end
end
context
"with updated .gitattrbutes"
do
context
"with updated .gitattrbutes"
do
before
(
:each
)
do
before
do
repository
.
copy_gitattributes
(
"gitattributes"
)
repository
.
copy_gitattributes
(
"gitattributes"
)
repository
.
copy_gitattributes
(
"gitattributes-updated"
)
repository
.
copy_gitattributes
(
"gitattributes-updated"
)
end
end
...
@@ -1070,13 +1070,13 @@ describe Gitlab::Git::Repository, seed_helper: true do
...
@@ -1070,13 +1070,13 @@ describe Gitlab::Git::Repository, seed_helper: true do
expect
(
contents
).
to
eq
(
"*.txt binary
\n
"
)
expect
(
contents
).
to
eq
(
"*.txt binary
\n
"
)
end
end
after
(
:each
)
do
after
do
FileUtils
.
rm_rf
(
attributes_path
)
FileUtils
.
rm_rf
(
attributes_path
)
end
end
end
end
context
"with no .gitattrbutes in HEAD but with previous info/attributes"
do
context
"with no .gitattrbutes in HEAD but with previous info/attributes"
do
before
(
:each
)
do
before
do
repository
.
copy_gitattributes
(
"gitattributes"
)
repository
.
copy_gitattributes
(
"gitattributes"
)
repository
.
copy_gitattributes
(
"master"
)
repository
.
copy_gitattributes
(
"master"
)
end
end
...
@@ -1085,7 +1085,7 @@ describe Gitlab::Git::Repository, seed_helper: true do
...
@@ -1085,7 +1085,7 @@ describe Gitlab::Git::Repository, seed_helper: true do
expect
(
File
.
exist?
(
attributes_path
)).
to
be_falsey
expect
(
File
.
exist?
(
attributes_path
)).
to
be_falsey
end
end
after
(
:each
)
do
after
do
FileUtils
.
rm_rf
(
attributes_path
)
FileUtils
.
rm_rf
(
attributes_path
)
end
end
end
end
...
...
spec/lib/gitlab/git/storage/circuit_breaker_spec.rb
View file @
c8b80247
...
@@ -174,7 +174,7 @@ describe Gitlab::Git::Storage::CircuitBreaker, clean_gitlab_redis_shared_state:
...
@@ -174,7 +174,7 @@ describe Gitlab::Git::Storage::CircuitBreaker, clean_gitlab_redis_shared_state:
end
end
describe
'#track_storage_inaccessible'
do
describe
'#track_storage_inaccessible'
do
around
(
:each
)
do
|
example
|
around
do
|
example
|
Timecop
.
freeze
Timecop
.
freeze
example
.
run
example
.
run
...
...
spec/lib/gitlab/health_checks/fs_shards_check_spec.rb
View file @
c8b80247
...
@@ -107,7 +107,7 @@ describe Gitlab::HealthChecks::FsShardsCheck do
...
@@ -107,7 +107,7 @@ describe Gitlab::HealthChecks::FsShardsCheck do
end
end
# Unsolved intermittent failure in CI https://gitlab.com/gitlab-org/gitlab-ce/issues/31128
# Unsolved intermittent failure in CI https://gitlab.com/gitlab-org/gitlab-ce/issues/31128
around
(
:each
)
do
|
example
|
# rubocop:disable RSpec/AroundBlock
around
do
|
example
|
# rubocop:disable RSpec/AroundBlock
times_to_try
=
ENV
[
'CI'
]
?
4
:
1
times_to_try
=
ENV
[
'CI'
]
?
4
:
1
example
.
run_with_retry
retry:
times_to_try
example
.
run_with_retry
retry:
times_to_try
end
end
...
...
spec/lib/gitlab/request_context_spec.rb
View file @
c8b80247
...
@@ -7,7 +7,7 @@ describe Gitlab::RequestContext do
...
@@ -7,7 +7,7 @@ describe Gitlab::RequestContext do
let
(
:env
)
{
Hash
.
new
}
let
(
:env
)
{
Hash
.
new
}
context
'when RequestStore::Middleware is used'
do
context
'when RequestStore::Middleware is used'
do
around
(
:each
)
do
|
example
|
around
do
|
example
|
RequestStore
::
Middleware
.
new
(
->
(
env
)
{
example
.
run
}).
call
({})
RequestStore
::
Middleware
.
new
(
->
(
env
)
{
example
.
run
}).
call
({})
end
end
...
...
spec/mailers/notify_spec.rb
View file @
c8b80247
...
@@ -545,7 +545,7 @@ describe Notify do
...
@@ -545,7 +545,7 @@ describe Notify do
let
(
:note_author
)
{
create
(
:user
,
name:
'author_name'
)
}
let
(
:note_author
)
{
create
(
:user
,
name:
'author_name'
)
}
let
(
:note
)
{
create
(
:note
,
project:
project
,
author:
note_author
)
}
let
(
:note
)
{
create
(
:note
,
project:
project
,
author:
note_author
)
}
before
:each
do
before
do
allow
(
Note
).
to
receive
(
:find
).
with
(
note
.
id
).
and_return
(
note
)
allow
(
Note
).
to
receive
(
:find
).
with
(
note
.
id
).
and_return
(
note
)
end
end
...
@@ -661,7 +661,7 @@ describe Notify do
...
@@ -661,7 +661,7 @@ describe Notify do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:note_author
)
{
create
(
:user
,
name:
'author_name'
)
}
let
(
:note_author
)
{
create
(
:user
,
name:
'author_name'
)
}
before
:each
do
before
do
allow
(
Note
).
to
receive
(
:find
).
with
(
note
.
id
).
and_return
(
note
)
allow
(
Note
).
to
receive
(
:find
).
with
(
note
.
id
).
and_return
(
note
)
end
end
...
@@ -779,7 +779,7 @@ describe Notify do
...
@@ -779,7 +779,7 @@ describe Notify do
context
'items that are noteable, the email for a diff discussion note'
do
context
'items that are noteable, the email for a diff discussion note'
do
let
(
:note_author
)
{
create
(
:user
,
name:
'author_name'
)
}
let
(
:note_author
)
{
create
(
:user
,
name:
'author_name'
)
}
before
:each
do
before
do
allow
(
Note
).
to
receive
(
:find
).
with
(
note
.
id
).
and_return
(
note
)
allow
(
Note
).
to
receive
(
:find
).
with
(
note
.
id
).
and_return
(
note
)
end
end
...
...
spec/models/concerns/issuable_spec.rb
View file @
c8b80247
...
@@ -300,7 +300,7 @@ describe Issuable do
...
@@ -300,7 +300,7 @@ describe Issuable do
let
(
:bug
)
{
create
(
:label
,
project:
project
,
title:
'bug'
)
}
let
(
:bug
)
{
create
(
:label
,
project:
project
,
title:
'bug'
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
before
(
:each
)
do
before
do
issue
.
labels
<<
bug
issue
.
labels
<<
bug
end
end
...
@@ -402,7 +402,7 @@ describe Issuable do
...
@@ -402,7 +402,7 @@ describe Issuable do
let
(
:issue2
)
{
create
(
:issue
,
title:
"Bugfix2"
,
project:
project
)
}
let
(
:issue2
)
{
create
(
:issue
,
title:
"Bugfix2"
,
project:
project
)
}
let
(
:issue3
)
{
create
(
:issue
,
title:
"Feature1"
,
project:
project
)
}
let
(
:issue3
)
{
create
(
:issue
,
title:
"Feature1"
,
project:
project
)
}
before
(
:each
)
do
before
do
issue1
.
labels
<<
bug
issue1
.
labels
<<
bug
issue1
.
labels
<<
feature
issue1
.
labels
<<
feature
issue2
.
labels
<<
bug
issue2
.
labels
<<
bug
...
...
spec/models/concerns/reactive_caching_spec.rb
View file @
c8b80247
...
@@ -31,7 +31,7 @@ describe ReactiveCaching, :use_clean_rails_memory_store_caching do
...
@@ -31,7 +31,7 @@ describe ReactiveCaching, :use_clean_rails_memory_store_caching do
let
(
:now
)
{
Time
.
now
.
utc
}
let
(
:now
)
{
Time
.
now
.
utc
}
around
(
:each
)
do
|
example
|
around
do
|
example
|
Timecop
.
freeze
(
now
)
{
example
.
run
}
Timecop
.
freeze
(
now
)
{
example
.
run
}
end
end
...
...
spec/models/merge_request_spec.rb
View file @
c8b80247
...
@@ -714,7 +714,7 @@ describe MergeRequest do
...
@@ -714,7 +714,7 @@ describe MergeRequest do
end
end
describe
'caching'
do
describe
'caching'
do
before
(
:example
)
do
before
do
allow
(
Rails
).
to
receive
(
:cache
).
and_return
(
ActiveSupport
::
Cache
::
MemoryStore
.
new
)
allow
(
Rails
).
to
receive
(
:cache
).
and_return
(
ActiveSupport
::
Cache
::
MemoryStore
.
new
)
end
end
...
...
spec/models/project_services/drone_ci_service_spec.rb
View file @
c8b80247
...
@@ -43,7 +43,7 @@ describe DroneCiService, :use_clean_rails_memory_store_caching do
...
@@ -43,7 +43,7 @@ describe DroneCiService, :use_clean_rails_memory_store_caching do
let
(
:build_page
)
{
"
#{
drone_url
}
/gitlab/
#{
path
}
/redirect/commits/
#{
sha
}
?branch=
#{
branch
}
"
}
let
(
:build_page
)
{
"
#{
drone_url
}
/gitlab/
#{
path
}
/redirect/commits/
#{
sha
}
?branch=
#{
branch
}
"
}
let
(
:commit_status_path
)
{
"
#{
drone_url
}
/gitlab/
#{
path
}
/commits/
#{
sha
}
?branch=
#{
branch
}
&access_token=
#{
token
}
"
}
let
(
:commit_status_path
)
{
"
#{
drone_url
}
/gitlab/
#{
path
}
/commits/
#{
sha
}
?branch=
#{
branch
}
&access_token=
#{
token
}
"
}
before
(
:each
)
do
before
do
allow
(
drone
).
to
receive_messages
(
allow
(
drone
).
to
receive_messages
(
project_id:
project
.
id
,
project_id:
project
.
id
,
project:
project
,
project:
project
,
...
...
spec/models/project_services/hipchat_service_spec.rb
View file @
c8b80247
...
@@ -36,7 +36,7 @@ describe HipchatService do
...
@@ -36,7 +36,7 @@ describe HipchatService do
Gitlab
::
DataBuilder
::
Push
.
build_sample
(
project
,
user
)
Gitlab
::
DataBuilder
::
Push
.
build_sample
(
project
,
user
)
end
end
before
(
:each
)
do
before
do
allow
(
hipchat
).
to
receive_messages
(
allow
(
hipchat
).
to
receive_messages
(
project_id:
project
.
id
,
project_id:
project
.
id
,
project:
project
,
project:
project
,
...
...
spec/models/project_spec.rb
View file @
c8b80247
...
@@ -651,7 +651,7 @@ describe Project do
...
@@ -651,7 +651,7 @@ describe Project do
let
(
:ext_project
)
{
create
(
:redmine_project
)
}
let
(
:ext_project
)
{
create
(
:redmine_project
)
}
context
'on existing projects with no value for has_external_issue_tracker'
do
context
'on existing projects with no value for has_external_issue_tracker'
do
before
(
:each
)
do
before
do
project
.
update_column
(
:has_external_issue_tracker
,
nil
)
project
.
update_column
(
:has_external_issue_tracker
,
nil
)
ext_project
.
update_column
(
:has_external_issue_tracker
,
nil
)
ext_project
.
update_column
(
:has_external_issue_tracker
,
nil
)
end
end
...
...
spec/requests/api/groups_spec.rb
View file @
c8b80247
...
@@ -512,7 +512,7 @@ describe API::Groups do
...
@@ -512,7 +512,7 @@ describe API::Groups do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project_path
)
{
CGI
.
escape
(
project
.
full_path
)
}
let
(
:project_path
)
{
CGI
.
escape
(
project
.
full_path
)
}
before
(
:each
)
do
before
do
allow_any_instance_of
(
Projects
::
TransferService
)
allow_any_instance_of
(
Projects
::
TransferService
)
.
to
receive
(
:execute
).
and_return
(
true
)
.
to
receive
(
:execute
).
and_return
(
true
)
end
end
...
...
spec/requests/api/merge_requests_spec.rb
View file @
c8b80247
...
@@ -580,7 +580,7 @@ describe API::MergeRequests do
...
@@ -580,7 +580,7 @@ describe API::MergeRequests do
let!
(
:fork_project
)
{
create
(
:project
,
forked_from_project:
project
,
namespace:
user2
.
namespace
,
creator_id:
user2
.
id
)
}
let!
(
:fork_project
)
{
create
(
:project
,
forked_from_project:
project
,
namespace:
user2
.
namespace
,
creator_id:
user2
.
id
)
}
let!
(
:unrelated_project
)
{
create
(
:project
,
namespace:
create
(
:user
).
namespace
,
creator_id:
user2
.
id
)
}
let!
(
:unrelated_project
)
{
create
(
:project
,
namespace:
create
(
:user
).
namespace
,
creator_id:
user2
.
id
)
}
before
:each
do
|
each
|
before
do
|
each
|
fork_project
.
team
<<
[
user2
,
:reporter
]
fork_project
.
team
<<
[
user2
,
:reporter
]
end
end
...
...
spec/requests/api/v3/groups_spec.rb
View file @
c8b80247
...
@@ -504,7 +504,7 @@ describe API::V3::Groups do
...
@@ -504,7 +504,7 @@ describe API::V3::Groups do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project_path
)
{
CGI
.
escape
(
project
.
full_path
)
}
let
(
:project_path
)
{
CGI
.
escape
(
project
.
full_path
)
}
before
(
:each
)
do
before
do
allow_any_instance_of
(
Projects
::
TransferService
)
allow_any_instance_of
(
Projects
::
TransferService
)
.
to
receive
(
:execute
).
and_return
(
true
)
.
to
receive
(
:execute
).
and_return
(
true
)
end
end
...
...
spec/requests/api/v3/merge_requests_spec.rb
View file @
c8b80247
...
@@ -315,7 +315,7 @@ describe API::MergeRequests do
...
@@ -315,7 +315,7 @@ describe API::MergeRequests do
let!
(
:fork_project
)
{
create
(
:project
,
forked_from_project:
project
,
namespace:
user2
.
namespace
,
creator_id:
user2
.
id
)
}
let!
(
:fork_project
)
{
create
(
:project
,
forked_from_project:
project
,
namespace:
user2
.
namespace
,
creator_id:
user2
.
id
)
}
let!
(
:unrelated_project
)
{
create
(
:project
,
namespace:
create
(
:user
).
namespace
,
creator_id:
user2
.
id
)
}
let!
(
:unrelated_project
)
{
create
(
:project
,
namespace:
create
(
:user
).
namespace
,
creator_id:
user2
.
id
)
}
before
:each
do
|
each
|
before
do
|
each
|
fork_project
.
team
<<
[
user2
,
:reporter
]
fork_project
.
team
<<
[
user2
,
:reporter
]
end
end
...
...
spec/services/labels/update_service_spec.rb
View file @
c8b80247
...
@@ -13,7 +13,7 @@ describe Labels::UpdateService do
...
@@ -13,7 +13,7 @@ describe Labels::UpdateService do
let
(
:expected_saved_color
)
{
hex_color
}
let
(
:expected_saved_color
)
{
hex_color
}
before
(
:each
)
do
before
do
@label
=
Labels
::
CreateService
.
new
(
title:
'Initial'
,
color:
'#000000'
).
execute
(
project:
project
)
@label
=
Labels
::
CreateService
.
new
(
title:
'Initial'
,
color:
'#000000'
).
execute
(
project:
project
)
expect
(
@label
).
to
be_persisted
expect
(
@label
).
to
be_persisted
end
end
...
...
spec/services/notification_service_spec.rb
View file @
c8b80247
...
@@ -4,7 +4,7 @@ describe NotificationService, :mailer do
...
@@ -4,7 +4,7 @@ describe NotificationService, :mailer do
let
(
:notification
)
{
described_class
.
new
}
let
(
:notification
)
{
described_class
.
new
}
let
(
:assignee
)
{
create
(
:user
)
}
let
(
:assignee
)
{
create
(
:user
)
}
around
(
:each
)
do
|
example
|
around
do
|
example
|
perform_enqueued_jobs
do
perform_enqueued_jobs
do
example
.
run
example
.
run
end
end
...
@@ -1196,7 +1196,7 @@ describe NotificationService, :mailer do
...
@@ -1196,7 +1196,7 @@ describe NotificationService, :mailer do
let
(
:group
)
{
create
(
:group
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:member
)
{
create
(
:user
)
}
let
(
:member
)
{
create
(
:user
)
}
before
(
:each
)
do
before
do
group
.
add_owner
(
creator
)
group
.
add_owner
(
creator
)
group
.
add_developer
(
member
,
creator
)
group
.
add_developer
(
member
,
creator
)
end
end
...
@@ -1216,7 +1216,7 @@ describe NotificationService, :mailer do
...
@@ -1216,7 +1216,7 @@ describe NotificationService, :mailer do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:member
)
{
create
(
:user
)
}
let
(
:member
)
{
create
(
:user
)
}
before
(
:each
)
do
before
do
project
.
add_developer
(
member
,
current_user:
project
.
owner
)
project
.
add_developer
(
member
,
current_user:
project
.
owner
)
end
end
...
...
spec/services/projects/housekeeping_service_spec.rb
View file @
c8b80247
...
@@ -24,7 +24,7 @@ describe Projects::HousekeepingService do
...
@@ -24,7 +24,7 @@ describe Projects::HousekeepingService do
end
end
context
'when no lease can be obtained'
do
context
'when no lease can be obtained'
do
before
(
:each
)
do
before
do
expect
(
subject
).
to
receive
(
:try_obtain_lease
).
and_return
(
false
)
expect
(
subject
).
to
receive
(
:try_obtain_lease
).
and_return
(
false
)
end
end
...
...
spec/services/web_hook_service_spec.rb
View file @
c8b80247
...
@@ -15,7 +15,7 @@ describe WebHookService do
...
@@ -15,7 +15,7 @@ describe WebHookService do
let
(
:service_instance
)
{
described_class
.
new
(
project_hook
,
data
,
'push_hooks'
)
}
let
(
:service_instance
)
{
described_class
.
new
(
project_hook
,
data
,
'push_hooks'
)
}
describe
'#execute'
do
describe
'#execute'
do
before
(
:each
)
do
before
do
project
.
hooks
<<
[
project_hook
]
project
.
hooks
<<
[
project_hook
]
WebMock
.
stub_request
(
:post
,
project_hook
.
url
)
WebMock
.
stub_request
(
:post
,
project_hook
.
url
)
...
...
spec/support/redis/redis_shared_examples.rb
View file @
c8b80247
...
@@ -3,12 +3,12 @@ RSpec.shared_examples "redis_shared_examples" do
...
@@ -3,12 +3,12 @@ RSpec.shared_examples "redis_shared_examples" do
let
(
:test_redis_url
)
{
"redis://redishost:
#{
redis_port
}
"
}
let
(
:test_redis_url
)
{
"redis://redishost:
#{
redis_port
}
"
}
before
(
:each
)
do
before
do
stub_env
(
environment_config_file_name
,
Rails
.
root
.
join
(
config_file_name
))
stub_env
(
environment_config_file_name
,
Rails
.
root
.
join
(
config_file_name
))
clear_raw_config
clear_raw_config
end
end
after
(
:each
)
do
after
do
clear_raw_config
clear_raw_config
end
end
...
...
spec/support/unique_ip_check_shared_examples.rb
View file @
c8b80247
shared_context
'unique ips sign in limit'
do
shared_context
'unique ips sign in limit'
do
include
StubENV
include
StubENV
before
(
:each
)
do
before
do
Gitlab
::
Redis
::
Cache
.
with
(
&
:flushall
)
Gitlab
::
Redis
::
Cache
.
with
(
&
:flushall
)
Gitlab
::
Redis
::
Queues
.
with
(
&
:flushall
)
Gitlab
::
Redis
::
Queues
.
with
(
&
:flushall
)
Gitlab
::
Redis
::
SharedState
.
with
(
&
:flushall
)
Gitlab
::
Redis
::
SharedState
.
with
(
&
:flushall
)
...
...
spec/tasks/config_lint_spec.rb
View file @
c8b80247
...
@@ -14,7 +14,7 @@ describe ConfigLint do
...
@@ -14,7 +14,7 @@ describe ConfigLint do
end
end
describe
'config_lint rake task'
do
describe
'config_lint rake task'
do
before
(
:each
)
do
before
do
# Prevent `system` from actually being called
# Prevent `system` from actually being called
allow
(
Kernel
).
to
receive
(
:system
).
and_return
(
true
)
allow
(
Kernel
).
to
receive
(
:system
).
and_return
(
true
)
end
end
...
...
spec/tasks/gitlab/backup_rake_spec.rb
View file @
c8b80247
...
@@ -119,7 +119,7 @@ describe 'gitlab:app namespace rake task' do
...
@@ -119,7 +119,7 @@ describe 'gitlab:app namespace rake task' do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user_backup_path
)
{
"repositories/
#{
project
.
disk_path
}
"
}
let
(
:user_backup_path
)
{
"repositories/
#{
project
.
disk_path
}
"
}
before
(
:each
)
do
before
do
@origin_cd
=
Dir
.
pwd
@origin_cd
=
Dir
.
pwd
path
=
File
.
join
(
project
.
repository
.
path_to_repo
,
filename
)
path
=
File
.
join
(
project
.
repository
.
path_to_repo
,
filename
)
...
@@ -130,7 +130,7 @@ describe 'gitlab:app namespace rake task' do
...
@@ -130,7 +130,7 @@ describe 'gitlab:app namespace rake task' do
create_backup
create_backup
end
end
after
(
:each
)
do
after
do
ENV
[
"SKIP"
]
=
""
ENV
[
"SKIP"
]
=
""
FileUtils
.
rm
(
@backup_tar
)
FileUtils
.
rm
(
@backup_tar
)
Dir
.
chdir
(
@origin_cd
)
Dir
.
chdir
(
@origin_cd
)
...
...
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