Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
694f84e1
Commit
694f84e1
authored
Aug 01, 2017
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EE-specific changes for `:empty_project` and `:repository`
parent
a15efe37
Changes
69
Show whitespace changes
Inline
Side-by-side
Showing
69 changed files
with
140 additions
and
140 deletions
+140
-140
spec/controllers/groups/analytics_controller_spec.rb
spec/controllers/groups/analytics_controller_spec.rb
+1
-1
spec/controllers/projects/issues_controller_ee_spec.rb
spec/controllers/projects/issues_controller_ee_spec.rb
+1
-1
spec/controllers/projects/merge_requests/creations_controller_ee_spec.rb
...s/projects/merge_requests/creations_controller_ee_spec.rb
+1
-1
spec/controllers/projects/merge_requests_controller_ee_spec.rb
...controllers/projects/merge_requests_controller_ee_spec.rb
+3
-3
spec/controllers/projects/mirrors_controller_spec.rb
spec/controllers/projects/mirrors_controller_spec.rb
+6
-6
spec/elastic_integration/global_search_spec.rb
spec/elastic_integration/global_search_spec.rb
+3
-3
spec/features/admin/admin_emails_spec.rb
spec/features/admin/admin_emails_spec.rb
+1
-1
spec/features/ci_shared_runner_settings_spec.rb
spec/features/ci_shared_runner_settings_spec.rb
+1
-1
spec/features/ci_shared_runner_warnings_spec.rb
spec/features/ci_shared_runner_warnings_spec.rb
+1
-1
spec/features/es_global_search_spec.rb
spec/features/es_global_search_spec.rb
+1
-1
spec/features/es_group_search_spec.rb
spec/features/es_group_search_spec.rb
+1
-1
spec/features/issues/ee/form_spec.rb
spec/features/issues/ee/form_spec.rb
+1
-1
spec/features/merge_requests/approvals_spec.rb
spec/features/merge_requests/approvals_spec.rb
+3
-3
spec/features/merge_requests/closes_issues_spec.rb
spec/features/merge_requests/closes_issues_spec.rb
+1
-1
spec/features/merge_requests/merge_with_push_rules_spec.rb
spec/features/merge_requests/merge_with_push_rules_spec.rb
+1
-1
spec/features/merge_requests/squash_spec.rb
spec/features/merge_requests/squash_spec.rb
+1
-1
spec/features/projects/audit_events_spec.rb
spec/features/projects/audit_events_spec.rb
+1
-1
spec/features/projects/jobs_spec.rb
spec/features/projects/jobs_spec.rb
+1
-1
spec/features/projects/members/member_is_removed_from_project_spec.rb
...s/projects/members/member_is_removed_from_project_spec.rb
+1
-1
spec/features/projects/mirror_spec.rb
spec/features/projects/mirror_spec.rb
+1
-1
spec/features/projects/path_locks_spec.rb
spec/features/projects/path_locks_spec.rb
+1
-1
spec/features/projects/remote_mirror_spec.rb
spec/features/projects/remote_mirror_spec.rb
+1
-1
spec/helpers/search_helper_spec.rb
spec/helpers/search_helper_spec.rb
+1
-1
spec/lib/gitlab/authority_analyzer_spec.rb
spec/lib/gitlab/authority_analyzer_spec.rb
+1
-1
spec/lib/gitlab/checks/change_access_spec.rb
spec/lib/gitlab/checks/change_access_spec.rb
+1
-1
spec/lib/gitlab/elastic/indexer_spec.rb
spec/lib/gitlab/elastic/indexer_spec.rb
+2
-2
spec/lib/gitlab/elastic/project_search_results_spec.rb
spec/lib/gitlab/elastic/project_search_results_spec.rb
+4
-4
spec/lib/gitlab/elastic/search_results_spec.rb
spec/lib/gitlab/elastic/search_results_spec.rb
+12
-12
spec/lib/gitlab/git_access_spec.rb
spec/lib/gitlab/git_access_spec.rb
+1
-1
spec/models/concerns/elastic/merge_request_spec.rb
spec/models/concerns/elastic/merge_request_spec.rb
+1
-1
spec/models/concerns/elastic/note_spec.rb
spec/models/concerns/elastic/note_spec.rb
+1
-1
spec/models/concerns/elastic/repository_spec.rb
spec/models/concerns/elastic/repository_spec.rb
+4
-4
spec/models/concerns/elastic/snippet_spec.rb
spec/models/concerns/elastic/snippet_spec.rb
+1
-1
spec/models/ee/ci/build_spec.rb
spec/models/ee/ci/build_spec.rb
+1
-1
spec/models/ee/merge_request_spec.rb
spec/models/ee/merge_request_spec.rb
+2
-2
spec/models/ee/project_spec.rb
spec/models/ee/project_spec.rb
+8
-8
spec/models/project_mirror_data_spec.rb
spec/models/project_mirror_data_spec.rb
+3
-3
spec/models/project_services/jenkins_deprecated_service_spec.rb
...odels/project_services/jenkins_deprecated_service_spec.rb
+2
-2
spec/models/project_services/jenkins_service_spec.rb
spec/models/project_services/jenkins_service_spec.rb
+5
-5
spec/models/project_spec.rb
spec/models/project_spec.rb
+20
-20
spec/models/remote_mirror_spec.rb
spec/models/remote_mirror_spec.rb
+3
-3
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+3
-3
spec/requests/api/members_spec.rb
spec/requests/api/members_spec.rb
+1
-1
spec/requests/api/project_push_rule_spec.rb
spec/requests/api/project_push_rule_spec.rb
+1
-1
spec/requests/api/v3/project_push_rule_spec.rb
spec/requests/api/v3/project_push_rule_spec.rb
+1
-1
spec/requests/projects/mirrors_controller_spec.rb
spec/requests/projects/mirrors_controller_spec.rb
+1
-1
spec/routing/webhook_routes_spec.rb
spec/routing/webhook_routes_spec.rb
+1
-1
spec/services/ee/issues/build_service_spec.rb
spec/services/ee/issues/build_service_spec.rb
+1
-1
spec/services/geo/move_repository_service_spec.rb
spec/services/geo/move_repository_service_spec.rb
+1
-1
spec/services/geo/repository_updated_event_store_spec.rb
spec/services/geo/repository_updated_event_store_spec.rb
+1
-1
spec/services/geo/schedule_repo_create_service_spec.rb
spec/services/geo/schedule_repo_create_service_spec.rb
+1
-1
spec/services/geo/schedule_repo_update_service_spec.rb
spec/services/geo/schedule_repo_update_service_spec.rb
+1
-1
spec/services/git_push_service_spec.rb
spec/services/git_push_service_spec.rb
+1
-1
spec/services/merge_requests/squash_service_spec.rb
spec/services/merge_requests/squash_service_spec.rb
+1
-1
spec/services/projects/destroy_service_spec.rb
spec/services/projects/destroy_service_spec.rb
+1
-1
spec/services/projects/slack_application_install_service_spec.rb
...rvices/projects/slack_application_install_service_spec.rb
+1
-1
spec/services/projects/update_mirror_service_spec.rb
spec/services/projects/update_mirror_service_spec.rb
+2
-2
spec/services/projects/update_remote_mirror_service_spec.rb
spec/services/projects/update_remote_mirror_service_spec.rb
+1
-1
spec/services/projects/update_repository_storage_service_spec.rb
...rvices/projects/update_repository_storage_service_spec.rb
+2
-2
spec/services/projects/update_service_spec.rb
spec/services/projects/update_service_spec.rb
+1
-1
spec/services/slash_commands/global_slack_handler_spec.rb
spec/services/slash_commands/global_slack_handler_spec.rb
+1
-1
spec/workers/admin_emails_worker_spec.rb
spec/workers/admin_emails_worker_spec.rb
+1
-1
spec/workers/elastic_commit_indexer_worker_spec.rb
spec/workers/elastic_commit_indexer_worker_spec.rb
+1
-1
spec/workers/elastic_indexer_worker_spec.rb
spec/workers/elastic_indexer_worker_spec.rb
+1
-1
spec/workers/geo_repository_create_worker_spec.rb
spec/workers/geo_repository_create_worker_spec.rb
+1
-1
spec/workers/geo_repository_update_worker_spec.rb
spec/workers/geo_repository_update_worker_spec.rb
+1
-1
spec/workers/project_update_repository_storage_worker_spec.rb
.../workers/project_update_repository_storage_worker_spec.rb
+1
-1
spec/workers/repository_update_mirror_worker_spec.rb
spec/workers/repository_update_mirror_worker_spec.rb
+3
-3
spec/workers/repository_update_remote_mirror_worker_spec.rb
spec/workers/repository_update_remote_mirror_worker_spec.rb
+1
-1
No files found.
spec/controllers/groups/analytics_controller_spec.rb
View file @
694f84e1
...
...
@@ -5,7 +5,7 @@ describe Groups::AnalyticsController do
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user3
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:project
,
group:
group
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
group:
group
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
:simple
,
source_project:
project
)
}
let
(
:push_data
)
{
Gitlab
::
DataBuilder
::
Push
.
build_sample
(
project
,
user
)
}
...
...
spec/controllers/projects/issues_controller_ee_spec.rb
View file @
694f84e1
...
...
@@ -78,7 +78,7 @@ describe Projects::IssuesController do
end
describe
'issue weights'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
,
weight:
5
)
}
let
(
:issue2
)
{
create
(
:issue
,
project:
project
,
weight:
1
)
}
...
...
spec/controllers/projects/merge_requests/creations_controller_ee_spec.rb
View file @
694f84e1
require
'spec_helper'
describe
Projects
::
MergeRequests
::
CreationsController
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:merge_request
)
{
create
(
:merge_request_with_diffs
,
target_project:
project
,
source_project:
project
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:viewer
)
{
user
}
...
...
spec/controllers/projects/merge_requests_controller_ee_spec.rb
View file @
694f84e1
require
'spec_helper'
describe
Projects
::
MergeRequestsController
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:merge_request
)
{
create
(
:merge_request_with_diffs
,
target_project:
project
,
source_project:
project
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:viewer
)
{
user
}
...
...
@@ -326,7 +326,7 @@ describe Projects::MergeRequestsController do
end
context
'approvals pending'
do
let
(
:project
)
{
create
(
:project
,
approvals_before_merge:
1
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
approvals_before_merge:
1
)
}
it
'returns 200'
do
expect_rebase_worker_for
(
viewer
)
...
...
@@ -338,7 +338,7 @@ describe Projects::MergeRequestsController do
end
context
'with a forked project'
do
let
(
:fork_project
)
{
create
(
:project
,
forked_from_project:
project
)
}
let
(
:fork_project
)
{
create
(
:project
,
:repository
,
forked_from_project:
project
)
}
let
(
:fork_owner
)
{
fork_project
.
owner
}
before
do
...
...
spec/controllers/projects/mirrors_controller_spec.rb
View file @
694f84e1
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
Projects
::
MirrorsController
do
describe
'setting up a remote mirror'
do
context
'when the current project is a mirror'
do
let
(
:project
)
{
create
(
:project
,
:mirror
)
}
let
(
:project
)
{
create
(
:project
,
:
repository
,
:
mirror
)
}
before
do
sign_in
(
project
.
owner
)
...
...
@@ -36,7 +36,7 @@ describe Projects::MirrorsController do
context
'when the current project is not a mirror'
do
it
'allows to create a remote mirror'
do
project
=
create
(
:project
)
project
=
create
(
:project
,
:repository
)
sign_in
(
project
.
owner
)
expect
do
...
...
@@ -46,7 +46,7 @@ describe Projects::MirrorsController do
end
context
'when the current project has a remote mirror'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:remote_mirror
)
{
project
.
remote_mirrors
.
create!
(
enabled:
1
,
url:
'http://local.dev'
)
}
before
do
...
...
@@ -95,7 +95,7 @@ describe Projects::MirrorsController do
end
context
'when project does not have a mirror'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
it
'allows to create a mirror'
do
expect_any_instance_of
(
EE
::
Project
).
to
receive
(
:force_import_job!
)
...
...
@@ -107,7 +107,7 @@ describe Projects::MirrorsController do
end
context
'when project has a mirror'
do
let
(
:project
)
{
create
(
:project
,
:mirror
,
:import_finished
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
:mirror
,
:import_finished
)
}
it
'is able to disable the mirror'
do
expect
{
do_put
(
project
,
mirror:
false
)
}.
to
change
{
Project
.
mirror
.
count
}.
to
(
0
)
...
...
@@ -119,7 +119,7 @@ describe Projects::MirrorsController do
it
'forces update'
do
expect_any_instance_of
(
EE
::
Project
).
to
receive
(
:force_import_job!
)
project
=
create
(
:project
,
:mirror
)
project
=
create
(
:
empty_
project
,
:mirror
)
sign_in
(
project
.
owner
)
put
:update_now
,
{
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
}
...
...
spec/elastic_integration/global_search_spec.rb
View file @
694f84e1
...
...
@@ -26,7 +26,7 @@ describe 'GlobalSearch' do
context
"Respect feature visibility levels"
do
context
"Private projects"
do
let
(
:project
)
{
create
(
:project
,
:private
)
}
let
(
:project
)
{
create
(
:project
,
:private
,
:repository
)
}
# The feature can be disabled but the data may actually exist
it
"does not find items if features are disabled"
do
...
...
@@ -57,7 +57,7 @@ describe 'GlobalSearch' do
end
context
"Internal projects"
do
let
(
:project
)
{
create
(
:project
,
:internal
)
}
let
(
:project
)
{
create
(
:project
,
:internal
,
:repository
)
}
# The feature can be disabled but the data may actually exist
it
"does not find items if features are disabled"
do
...
...
@@ -101,7 +101,7 @@ describe 'GlobalSearch' do
end
context
"Public projects"
do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
# The feature can be disabled but the data may actually exist
it
"does not find items if features are disabled"
do
...
...
spec/features/admin/admin_emails_spec.rb
View file @
694f84e1
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
"Admin::Emails"
,
:js
do
let!
(
:current_user
)
{
create
(
:admin
)
}
let!
(
:group
)
{
create
(
:group
)
}
let!
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
let!
(
:project
)
{
create
(
:
empty_
project
,
namespace:
group
)
}
describe
"GET /admin/email"
do
before
do
...
...
spec/features/ci_shared_runner_settings_spec.rb
View file @
694f84e1
...
...
@@ -5,7 +5,7 @@ feature 'CI shared runner settings' do
let
(
:admin
)
{
create
(
:admin
)
}
let
(
:group
)
{
create
(
:group
,
:with_build_minutes
)
}
let!
(
:project
)
{
create
(
:project
,
namespace:
group
,
shared_runners_enabled:
true
)
}
let!
(
:project
)
{
create
(
:
empty_
project
,
namespace:
group
,
shared_runners_enabled:
true
)
}
before
do
stub_env
(
'IN_MEMORY_APPLICATION_SETTINGS'
,
'false'
)
...
...
spec/features/ci_shared_runner_warnings_spec.rb
View file @
694f84e1
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
feature
'CI shared runner limits'
do
let
(
:user
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
,
namespace:
group
,
shared_runners_enabled:
true
)
}
let!
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
group
,
shared_runners_enabled:
true
)
}
let
(
:group
)
{
create
(
:group
)
}
before
do
...
...
spec/features/es_global_search_spec.rb
View file @
694f84e1
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
feature
'Global elastic search'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
user
.
namespace
)
}
before
do
stub_application_setting
(
elasticsearch_search:
true
,
elasticsearch_indexing:
true
)
...
...
spec/features/es_group_search_spec.rb
View file @
694f84e1
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
feature
'Group elastic search'
,
:js
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
group
)
}
def
choose_group
(
group
)
find
(
'.js-search-group-dropdown'
).
trigger
(
'click'
)
...
...
spec/features/issues/ee/form_spec.rb
View file @
694f84e1
...
...
@@ -5,7 +5,7 @@ describe 'New/edit issue', :js do
include
ActionView
::
Helpers
::
JavaScriptHelper
include
FormHelper
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:project
)
{
create
(
:
empty_
project
)
}
let!
(
:user
)
{
create
(
:user
)}
let!
(
:user2
)
{
create
(
:user
)}
let!
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
...
...
spec/features/merge_requests/approvals_spec.rb
View file @
694f84e1
...
...
@@ -2,7 +2,7 @@ require 'rails_helper'
feature
'Merge request approvals'
,
:js
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
approvals_before_merge:
1
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
approvals_before_merge:
1
)
}
context
'when editing an MR with a different author'
do
let
(
:author
)
{
create
(
:user
)
}
...
...
@@ -30,7 +30,7 @@ feature 'Merge request approvals', :js do
context
'when creating an MR from a fork'
do
let
(
:other_user
)
{
create
(
:user
)
}
let
(
:non_member
)
{
create
(
:user
)
}
let
(
:forked_project
)
{
create
(
:project
,
:public
,
creator:
user
)
}
let
(
:forked_project
)
{
create
(
:project
,
:public
,
:repository
,
creator:
user
)
}
before
do
create
(
:forked_project_link
,
forked_to_project:
forked_project
,
forked_from_project:
project
)
...
...
@@ -269,7 +269,7 @@ feature 'Merge request approvals', :js do
context
'when merge when discussions resolved is active'
,
:js
do
let
(
:project
)
do
create
(
:project
,
create
(
:project
,
:repository
,
approvals_before_merge:
1
,
only_allow_merge_if_all_discussions_are_resolved:
true
)
end
...
...
spec/features/merge_requests/closes_issues_spec.rb
View file @
694f84e1
...
...
@@ -87,7 +87,7 @@ feature 'Merge Request closing issues message', js: true do
project
.
team
<<
[
user
,
:developer
]
end
let
(
:project
)
{
create
(
:project
,
:public
,
approvals_before_merge:
1
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
approvals_before_merge:
1
)
}
let
(
:merge_request_description
)
{
"Description
\n\n
closing
#{
issue_1
.
to_reference
}
,
#{
issue_2
.
to_reference
}
"
}
it
'displays closing issue message exactly one time'
do
...
...
spec/features/merge_requests/merge_with_push_rules_spec.rb
View file @
694f84e1
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
feature
'Merge With Push Rules Validation'
,
:js
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
push_rule:
push_rule
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
push_rule:
push_rule
)
}
let
(
:merge_request
)
{
create
(
:merge_request_with_diffs
,
source_project:
project
,
author:
user
,
title:
'Bug NS-04'
)
}
before
do
...
...
spec/features/merge_requests/squash_spec.rb
View file @
694f84e1
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
feature
'Squashing merge requests'
,
:js
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:source_branch
)
{
'csv'
}
let!
(
:original_head
)
{
project
.
repository
.
commit
(
'master'
)
}
...
...
spec/features/projects/audit_events_spec.rb
View file @
694f84e1
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
feature
'Projects > Audit Events'
,
:js
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:pete
)
{
create
(
:user
,
name:
'Pete'
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
user
.
namespace
)
}
before
do
project
.
team
<<
[
user
,
:master
]
...
...
spec/features/projects/jobs_spec.rb
View file @
694f84e1
...
...
@@ -354,7 +354,7 @@ feature 'Jobs' do
context
'job project is over shared runners limit'
do
let
(
:group
)
{
create
(
:group
,
:with_used_build_minutes_limit
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
group
,
shared_runners_enabled:
true
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
group
,
shared_runners_enabled:
true
)
}
it
'displays a warning message'
do
visit
project_job_path
(
project
,
job
)
...
...
spec/features/projects/members/member_is_removed_from_project_spec.rb
View file @
694f84e1
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
feature
'Projects > Members > Member is removed from project'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
background
do
project
.
team
<<
[
user
,
:master
]
...
...
spec/features/projects/mirror_spec.rb
View file @
694f84e1
require
'spec_helper'
feature
'Project mirror'
do
let
(
:project
)
{
create
(
:project
,
:mirror
,
:import_finished
,
creator:
user
,
name:
'Victorialand'
)
}
let
(
:project
)
{
create
(
:project
,
:mirror
,
:import_finished
,
:repository
,
creator:
user
,
name:
'Victorialand'
)
}
let
(
:user
)
{
create
(
:user
)
}
describe
'On a project'
,
js:
true
do
...
...
spec/features/projects/path_locks_spec.rb
View file @
694f84e1
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
feature
'Path Locks'
,
:js
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
user
.
namespace
)
}
let
(
:tree_path
)
{
project_tree_path
(
project
,
project
.
repository
.
root_ref
)
}
before
do
...
...
spec/features/projects/remote_mirror_spec.rb
View file @
694f84e1
require
'spec_helper'
feature
'Project remote mirror'
,
feature:
true
do
let
(
:project
)
{
create
(
:project
,
:remote_mirror
)
}
let
(
:project
)
{
create
(
:project
,
:re
pository
,
:re
mote_mirror
)
}
let
(
:remote_mirror
)
{
project
.
remote_mirrors
.
first
}
let
(
:user
)
{
create
(
:user
)
}
...
...
spec/helpers/search_helper_spec.rb
View file @
694f84e1
...
...
@@ -18,7 +18,7 @@ describe SearchHelper do
end
it
"returns parsed result"
do
project
=
create
:project
project
=
create
:project
,
:repository
project
.
repository
.
index_blobs
...
...
spec/lib/gitlab/authority_analyzer_spec.rb
View file @
694f84e1
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
Gitlab
::
AuthorityAnalyzer
do
describe
'#calculate'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:author
)
{
create
(
:user
)
}
let
(
:user_a
)
{
create
(
:user
)
}
let
(
:user_b
)
{
create
(
:user
)
}
...
...
spec/lib/gitlab/checks/change_access_spec.rb
View file @
694f84e1
...
...
@@ -173,7 +173,7 @@ describe Gitlab::Checks::ChangeAccess do
it
{
is_expected
.
to
be_truthy
}
end
let
(
:project
)
{
create
(
:project
,
:public
,
push_rule:
push_rule
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
push_rule:
push_rule
)
}
before
do
allow
(
project
.
repository
).
to
receive
(
:new_commits
).
and_return
(
...
...
spec/lib/gitlab/elastic/indexer_spec.rb
View file @
694f84e1
...
...
@@ -8,7 +8,7 @@ describe Gitlab::Elastic::Indexer do
stub_application_setting
(
elasticsearch_url:
[
'http://localhost:9200'
])
end
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:from_sha
)
{
Gitlab
::
Git
::
BLANK_SHA
}
let
(
:to_sha
)
{
project
.
commit
.
try
(
:sha
)
}
let
(
:indexer
)
{
described_class
.
new
(
project
)
}
...
...
@@ -40,7 +40,7 @@ describe Gitlab::Elastic::Indexer do
end
context
'test project'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
it
'runs the indexing command'
do
expect_popen
.
with
(
...
...
spec/lib/gitlab/elastic/project_search_results_spec.rb
View file @
694f84e1
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
Gitlab
::
Elastic
::
ProjectSearchResults
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:query
)
{
'hello world'
}
before
do
...
...
@@ -34,8 +34,8 @@ describe Gitlab::Elastic::ProjectSearchResults do
describe
"search"
do
it
"returns correct amounts"
do
project
=
create
:project
,
:public
project1
=
create
:project
,
:public
project
=
create
:project
,
:public
,
:repository
project1
=
create
:project
,
:public
,
:repository
project
.
repository
.
index_blobs
project
.
repository
.
index_commits
...
...
@@ -81,7 +81,7 @@ describe Gitlab::Elastic::ProjectSearchResults do
end
describe
"search for commits in non-default branch"
do
let
(
:project
)
{
create
(
:project
,
:public
,
visibility
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
visibility
)
}
let
(
:visibility
)
{
:repository_enabled
}
let
(
:result
)
{
described_class
.
new
(
user
,
'initial'
,
project
.
id
,
'test'
)
}
...
...
spec/lib/gitlab/elastic/search_results_spec.rb
View file @
694f84e1
...
...
@@ -12,8 +12,8 @@ describe Gitlab::Elastic::SearchResults do
end
let
(
:user
)
{
create
(
:user
)
}
let
(
:project_1
)
{
create
(
:project
)
}
let
(
:project_2
)
{
create
(
:project
)
}
let
(
:project_1
)
{
create
(
:project
,
:repository
)
}
let
(
:project_2
)
{
create
(
:project
,
:repository
)
}
let
(
:limit_project_ids
)
{
[
project_1
.
id
]
}
describe
'issues'
do
...
...
@@ -334,7 +334,7 @@ describe Gitlab::Elastic::SearchResults do
describe
'project scoping'
do
it
"returns items for project"
do
project
=
create
:project
,
name:
"term"
project
=
create
:project
,
:repository
,
name:
"term"
# Create issue
create
:issue
,
title:
'bla-bla term'
,
project:
project
...
...
@@ -383,7 +383,7 @@ describe Gitlab::Elastic::SearchResults do
end
it
'finds blobs from public projects only'
do
project_2
=
create
:project
,
:private
project_2
=
create
:project
,
:
repository
,
:
private
project_2
.
repository
.
index_blobs
Gitlab
::
Elastic
::
Helper
.
refresh_index
...
...
@@ -468,7 +468,7 @@ describe Gitlab::Elastic::SearchResults do
end
it
'finds wiki blobs from public projects only'
do
project_2
=
create
:project
,
:private
project_2
=
create
:project
,
:
repository
,
:
private
project_2
.
wiki
.
create_page
(
'index_page'
,
'term'
)
project_2
.
wiki
.
index_blobs
Gitlab
::
Elastic
::
Helper
.
refresh_index
...
...
@@ -486,7 +486,7 @@ describe Gitlab::Elastic::SearchResults do
end
context
'when wiki is disabled'
do
let
(
:project_1
)
{
create
(
:project
,
:public
,
:wiki_disabled
)
}
let
(
:project_1
)
{
create
(
:project
,
:public
,
:
repository
,
:
wiki_disabled
)
}
context
'search by member'
do
let
(
:limit_project_ids
)
{
[
project_1
.
id
]
}
...
...
@@ -502,7 +502,7 @@ describe Gitlab::Elastic::SearchResults do
end
context
'when wiki is internal'
do
let
(
:project_1
)
{
create
(
:project
,
:public
,
:wiki_private
)
}
let
(
:project_1
)
{
create
(
:project
,
:public
,
:
repository
,
:
wiki_private
)
}
context
'search by member'
do
let
(
:limit_project_ids
)
{
[
project_1
.
id
]
}
...
...
@@ -534,7 +534,7 @@ describe Gitlab::Elastic::SearchResults do
end
it
'finds commits from public projects only'
do
project_2
=
create
:project
,
:private
project_2
=
create
:project
,
:private
,
:repository
project_2
.
repository
.
index_commits
Gitlab
::
Elastic
::
Helper
.
refresh_index
...
...
@@ -553,10 +553,10 @@ describe Gitlab::Elastic::SearchResults do
end
describe
'Visibility levels'
do
let
(
:internal_project
)
{
create
(
:project
,
:internal
,
description:
"Internal project"
)
}
let
(
:private_project1
)
{
create
(
:project
,
:private
,
description:
"Private project"
)
}
let
(
:private_project2
)
{
create
(
:project
,
:private
,
description:
"Private project where I'm a member"
)
}
let
(
:public_project
)
{
create
(
:project
,
:public
,
description:
"Public project"
)
}
let
(
:internal_project
)
{
create
(
:project
,
:internal
,
:repository
,
description:
"Internal project"
)
}
let
(
:private_project1
)
{
create
(
:project
,
:private
,
:repository
,
description:
"Private project"
)
}
let
(
:private_project2
)
{
create
(
:project
,
:private
,
:repository
,
description:
"Private project where I'm a member"
)
}
let
(
:public_project
)
{
create
(
:project
,
:public
,
:repository
,
description:
"Public project"
)
}
let
(
:limit_project_ids
)
{
[
private_project2
.
id
]
}
before
do
...
...
spec/lib/gitlab/git_access_spec.rb
View file @
694f84e1
...
...
@@ -928,7 +928,7 @@ describe Gitlab::GitAccess do
end
context
'when the repository is read only'
do
let
(
:project
)
{
create
(
:project
,
:read_only_repository
)
}
let
(
:project
)
{
create
(
:project
,
:re
pository
,
:re
ad_only_repository
)
}
it
'denies push access'
do
project
.
team
<<
[
user
,
:master
]
...
...
spec/models/concerns/elastic/merge_request_spec.rb
View file @
694f84e1
...
...
@@ -12,7 +12,7 @@ describe MergeRequest, elastic: true do
end
it
"searches merge requests"
do
project
=
create
:project
project
=
create
:project
,
:repository
Sidekiq
::
Testing
.
inline!
do
create
:merge_request
,
title:
'bla-bla term1'
,
source_project:
project
...
...
spec/models/concerns/elastic/note_spec.rb
View file @
694f84e1
...
...
@@ -65,7 +65,7 @@ describe Note, elastic: true do
end
it
"does not create ElasticIndexerWorker job for system messages"
do
project
=
create
:project
project
=
create
:project
,
:repository
issue
=
create
:issue
,
project:
project
# Only issue should be updated
...
...
spec/models/concerns/elastic/repository_spec.rb
View file @
694f84e1
...
...
@@ -12,7 +12,7 @@ describe Repository, elastic: true do
end
it
"searches blobs and commits"
do
project
=
create
:project
project
=
create
:project
,
:repository
Sidekiq
::
Testing
.
inline!
do
project
.
repository
.
index_blobs
...
...
@@ -28,8 +28,8 @@ describe Repository, elastic: true do
describe
"class method find_commits_by_message_with_elastic"
do
it
"returns commits"
do
project
=
create
:project
project1
=
create
:project
project
=
create
:project
,
:repository
project1
=
create
:project
,
:repository
project
.
repository
.
index_commits
project1
.
repository
.
index_commits
...
...
@@ -44,7 +44,7 @@ describe Repository, elastic: true do
describe
"find_commits_by_message_with_elastic"
do
it
"returns commits"
do
project
=
create
:project
project
=
create
:project
,
:repository
project
.
repository
.
index_commits
...
...
spec/models/concerns/elastic/snippet_spec.rb
View file @
694f84e1
...
...
@@ -13,7 +13,7 @@ describe Snippet, elastic: true do
context
'searching snippets by code'
do
let!
(
:author
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:project
)
{
create
(
:
empty_
project
)
}
let!
(
:public_snippet
)
{
create
(
:snippet
,
:public
,
content:
'password: XXX'
)
}
let!
(
:internal_snippet
)
{
create
(
:snippet
,
:internal
,
content:
'password: XXX'
)
}
...
...
spec/models/ee/ci/build_spec.rb
View file @
694f84e1
require
'spec_helper'
describe
Ci
::
Build
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:pipeline
)
do
create
(
:ci_pipeline
,
project:
project
,
...
...
spec/models/ee/merge_request_spec.rb
View file @
694f84e1
require
'spec_helper'
describe
MergeRequest
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
subject
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
target_project:
project
)
}
...
...
@@ -19,7 +19,7 @@ describe MergeRequest do
end
context
'project allows rebase'
do
let
(
:project
)
{
create
(
:project
,
merge_requests_rebase_enabled:
true
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
merge_requests_rebase_enabled:
true
)
}
it
'returns false when the project feature is unavailable'
do
expect
(
merge_request
.
target_project
).
to
receive
(
:feature_available?
).
with
(
:merge_request_rebase
).
at_least
(
:once
).
and_return
(
false
)
...
...
spec/models/ee/project_spec.rb
View file @
694f84e1
...
...
@@ -17,7 +17,7 @@ describe Project do
end
describe
'#push_rule'
do
let
(
:project
)
{
create
(
:project
,
push_rule:
create
(
:push_rule
))
}
let
(
:project
)
{
create
(
:
empty_
project
,
push_rule:
create
(
:push_rule
))
}
subject
(
:push_rule
)
{
project
.
push_rule
(
true
)
}
...
...
@@ -63,7 +63,7 @@ describe Project do
describe
'#execute_hooks'
do
it
"triggers project and group hooks"
do
group
=
create
:group
,
name:
'gitlab'
project
=
create
(
:project
,
name:
'gitlabhq'
,
namespace:
group
)
project
=
create
(
:
empty_
project
,
name:
'gitlabhq'
,
namespace:
group
)
project_hook
=
create
(
:project_hook
,
push_events:
true
,
project:
project
)
group_hook
=
create
(
:group_hook
,
push_events:
true
,
group:
group
)
...
...
@@ -78,7 +78,7 @@ describe Project do
end
describe
'#allowed_to_share_with_group?'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
it
"returns true"
do
expect
(
project
.
allowed_to_share_with_group?
).
to
be_truthy
...
...
@@ -92,7 +92,7 @@ describe Project do
describe
'#feature_available?'
do
let
(
:namespace
)
{
build_stubbed
(
:namespace
)
}
let
(
:project
)
{
build_stubbed
(
:project
,
namespace:
namespace
)
}
let
(
:project
)
{
build_stubbed
(
:
empty_
project
,
namespace:
namespace
)
}
let
(
:user
)
{
build_stubbed
(
:user
)
}
subject
{
project
.
feature_available?
(
feature
,
user
)
}
...
...
@@ -647,7 +647,7 @@ describe Project do
].
each
do
|
spec
|
context
spec
.
inspect
do
let
(
:spec
)
{
spec
}
let
(
:project
)
{
build
(
:project
,
approvals_before_merge:
spec
[
:database
])
}
let
(
:project
)
{
build
(
:
empty_
project
,
approvals_before_merge:
spec
[
:database
])
}
subject
{
project
.
approvals_before_merge
}
...
...
@@ -669,7 +669,7 @@ describe Project do
].
each
do
|
spec
|
context
spec
.
inspect
do
let
(
:spec
)
{
spec
}
let
(
:project
)
{
build
(
:project
,
reset_approvals_on_push:
spec
[
:database
])
}
let
(
:project
)
{
build
(
:
empty_
project
,
reset_approvals_on_push:
spec
[
:database
])
}
subject
{
project
.
reset_approvals_on_push?
}
...
...
@@ -691,7 +691,7 @@ describe Project do
].
each
do
|
spec
|
context
spec
.
inspect
do
let
(
:spec
)
{
spec
}
let
(
:project
)
{
build
(
:project
,
approvals_before_merge:
spec
[
:database
])
}
let
(
:project
)
{
build
(
:
empty_
project
,
approvals_before_merge:
spec
[
:database
])
}
subject
{
project
.
approvals_before_merge
}
...
...
@@ -785,7 +785,7 @@ describe Project do
describe
'#disabled_services'
do
let
(
:namespace
)
{
create
(
:group
,
:private
)
}
let
(
:project
)
{
create
(
:project
,
:private
,
namespace:
namespace
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
:private
,
namespace:
namespace
)
}
let
(
:disabled_services
)
{
%w(jenkins jenkins_deprecated)
}
context
'without a license key'
do
...
...
spec/models/project_mirror_data_spec.rb
View file @
694f84e1
...
...
@@ -28,7 +28,7 @@ describe ProjectMirrorData, type: :model do
end
describe
'#reset_retry_count!'
do
let
(
:mirror_data
)
{
create
(
:project
,
:mirror
,
:import_finished
).
mirror_data
}
let
(
:mirror_data
)
{
create
(
:
empty_
project
,
:mirror
,
:import_finished
).
mirror_data
}
it
'resets retry_count to 0'
do
mirror_data
.
retry_count
=
3
...
...
@@ -38,7 +38,7 @@ describe ProjectMirrorData, type: :model do
end
describe
'#increment_retry_count!'
do
let
(
:mirror_data
)
{
create
(
:project
,
:mirror
,
:import_finished
).
mirror_data
}
let
(
:mirror_data
)
{
create
(
:
empty_
project
,
:mirror
,
:import_finished
).
mirror_data
}
it
'increments retry_count'
do
expect
{
mirror_data
.
increment_retry_count!
}.
to
change
{
mirror_data
.
retry_count
}.
from
(
0
).
to
(
1
)
...
...
@@ -46,7 +46,7 @@ describe ProjectMirrorData, type: :model do
end
describe
'#set_next_execution_timestamp!'
do
let
(
:mirror_data
)
{
create
(
:project
,
:mirror
,
:import_finished
).
mirror_data
}
let
(
:mirror_data
)
{
create
(
:
empty_
project
,
:mirror
,
:import_finished
).
mirror_data
}
let!
(
:timestamp
)
{
Time
.
now
}
let!
(
:jitter
)
{
2
.
seconds
}
let
(
:interval
)
{
2
.
minutes
}
...
...
spec/models/project_services/jenkins_deprecated_service_spec.rb
View file @
694f84e1
...
...
@@ -62,7 +62,7 @@ eos
end
describe
'multiproject enabled'
do
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:project
)
{
create
(
:
empty_
project
)
}
before
do
@service
=
JenkinsDeprecatedService
.
new
allow
(
@service
).
to
receive_messages
(
...
...
@@ -123,7 +123,7 @@ eos
describe
'#execute'
do
let
(
:user
)
{
create
(
:user
,
username:
'username'
)
}
let
(
:namespace
)
{
create
(
:group
,
:private
)
}
let
(
:project
)
{
create
(
:project
,
:private
,
name:
'project'
,
namespace:
namespace
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
:private
,
name:
'project'
,
namespace:
namespace
)
}
let
(
:push_sample_data
)
{
Gitlab
::
DataBuilder
::
Push
.
build_sample
(
project
,
user
)
}
let
(
:jenkins_service
)
{
described_class
.
create
(
active:
true
,
project:
project
)
}
let!
(
:service_hook
)
{
create
(
:service_hook
,
service:
jenkins_service
)
}
...
...
spec/models/project_services/jenkins_service_spec.rb
View file @
694f84e1
...
...
@@ -6,7 +6,7 @@ describe JenkinsService do
it
{
is_expected
.
to
have_one
:service_hook
}
end
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:jenkins_url
)
{
'http://jenkins.example.com/'
}
let
(
:jenkins_hook_url
)
{
jenkins_url
+
'project/my_project'
}
...
...
@@ -125,7 +125,7 @@ describe JenkinsService do
describe
'#test'
do
it
'returns the right status'
do
user
=
create
(
:user
,
username:
'username'
)
project
=
create
(
:project
,
name:
'project'
)
project
=
create
(
:
empty_
project
,
name:
'project'
)
push_sample_data
=
Gitlab
::
DataBuilder
::
Push
.
build_sample
(
project
,
user
)
jenkins_service
=
described_class
.
create
(
jenkins_params
)
stub_request
(
:post
,
jenkins_hook_url
).
with
(
headers:
{
'Authorization'
=>
jenkins_authorization
})
...
...
@@ -155,7 +155,7 @@ describe JenkinsService do
describe
'#execute'
do
let
(
:user
)
{
create
(
:user
,
username:
'username'
)
}
let
(
:namespace
)
{
create
(
:group
,
:private
)
}
let
(
:project
)
{
create
(
:project
,
:private
,
name:
'project'
,
namespace:
namespace
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
:private
,
name:
'project'
,
namespace:
namespace
)
}
let
(
:push_sample_data
)
{
Gitlab
::
DataBuilder
::
Push
.
build_sample
(
project
,
user
)
}
let
(
:jenkins_service
)
{
described_class
.
create
(
jenkins_params
)
}
...
...
@@ -217,7 +217,7 @@ describe JenkinsService do
end
describe
'Stored password invalidation'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
context
'when a password was previously set'
do
before
do
...
...
@@ -268,7 +268,7 @@ describe JenkinsService do
context
'when no password was previously set'
do
before
do
@jenkins_service
=
described_class
.
create
(
project:
create
(
:project
),
project:
create
(
:
empty_
project
),
properties:
{
jenkins_url:
'http://jenkins.example.com/'
,
username:
'jenkins'
...
...
spec/models/project_spec.rb
View file @
694f84e1
...
...
@@ -126,7 +126,7 @@ describe Project do
context
'#with_wiki_enabled'
do
it
'returns a project'
do
project
=
create
(
:project_empty_repo
,
wiki_access_level:
ProjectFeature
::
ENABLED
)
project1
=
create
(
:project
,
wiki_access_level:
ProjectFeature
::
DISABLED
)
project1
=
create
(
:
empty_
project
,
wiki_access_level:
ProjectFeature
::
DISABLED
)
expect
(
described_class
.
with_wiki_enabled
).
to
include
(
project
)
expect
(
described_class
.
with_wiki_enabled
).
not_to
include
(
project1
)
...
...
@@ -201,7 +201,7 @@ describe Project do
context
'#mark_stuck_remote_mirrors_as_failed!'
do
it
'fails stuck remote mirrors'
do
project
=
create
(
:project
,
:remote_mirror
)
project
=
create
(
:project
,
:remote_mirror
,
:repository
)
project
.
remote_mirrors
.
first
.
update_attributes
(
update_status: :started
,
...
...
@@ -215,7 +215,7 @@ describe Project do
end
context
'mirror'
do
subject
{
build
(
:project
,
mirror:
true
)
}
subject
{
build
(
:
empty_
project
,
mirror:
true
)
}
it
{
is_expected
.
to
validate_presence_of
(
:import_url
)
}
it
{
is_expected
.
to
validate_presence_of
(
:mirror_user
)
}
...
...
@@ -1627,7 +1627,7 @@ describe Project do
describe
'handling import URL'
do
context
'when project is a mirror'
do
it
'returns the full URL'
do
project
=
create
(
:project
,
:mirror
,
import_url:
'http://user:pass@test.com'
)
project
=
create
(
:
empty_
project
,
:mirror
,
import_url:
'http://user:pass@test.com'
)
project
.
import_finish
...
...
@@ -1637,7 +1637,7 @@ describe Project do
context
'when project is not a mirror'
do
it
'returns the sanitized URL'
do
project
=
create
(
:project
,
import_status:
'started'
,
import_url:
'http://user:pass@test.com'
)
project
=
create
(
:
empty_
project
,
import_status:
'started'
,
import_url:
'http://user:pass@test.com'
)
project
.
import_finish
...
...
@@ -1878,7 +1878,7 @@ describe Project do
end
context
'elasticsearch indexing enabled'
do
let
(
:project
)
{
create
(
:project
,
:import_started
,
import_type: :github
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
:import_started
,
import_type: :github
)
}
before
do
stub_application_setting
(
elasticsearch_indexing:
true
)
...
...
@@ -1988,7 +1988,7 @@ describe Project do
context
'when mirror is expected to run soon'
do
it
'returns true'
do
timestamp
=
Time
.
now
project
=
create
(
:project
,
:mirror
,
:import_finished
)
project
=
create
(
:project
,
:mirror
,
:import_finished
,
:repository
)
project
.
mirror_last_update_at
=
timestamp
-
3
.
minutes
project
.
mirror_data
.
next_execution_timestamp
=
timestamp
-
2
.
minutes
...
...
@@ -1999,7 +1999,7 @@ describe Project do
context
'when mirror was scheduled'
do
it
'returns true'
do
project
=
create
(
:project
,
:mirror
,
:import_scheduled
)
project
=
create
(
:project
,
:mirror
,
:import_scheduled
,
:repository
)
expect
(
project
.
scheduled_mirror?
).
to
be
true
end
...
...
@@ -2017,7 +2017,7 @@ describe Project do
context
'when project is not a mirror'
do
it
'returns false'
do
project
=
create
(
:project
,
:import_started
)
project
=
create
(
:
empty_
project
,
:import_started
)
expect
(
project
.
updating_mirror?
).
to
be
false
end
...
...
@@ -2025,7 +2025,7 @@ describe Project do
context
'when mirror is in progress'
do
it
'returns true'
do
project
=
create
(
:project
,
:mirror
,
:import_started
)
project
=
create
(
:project
,
:mirror
,
:import_started
,
:repository
)
expect
(
project
.
updating_mirror?
).
to
be
true
end
...
...
@@ -2035,7 +2035,7 @@ describe Project do
describe
'#force_import_job!'
do
it
'sets next execution timestamp to now and schedules UpdateAllMirrorsWorker'
do
timestamp
=
Time
.
now
project
=
create
(
:project
,
:mirror
)
project
=
create
(
:
empty_
project
,
:mirror
)
project
.
mirror_data
.
update_attributes
(
next_execution_timestamp:
timestamp
-
3
.
minutes
)
...
...
@@ -2062,7 +2062,7 @@ describe Project do
context
'without mirror'
do
it
'returns nil'
do
project
=
create
(
:project
)
project
=
create
(
:
empty_
project
)
expect
(
project
.
add_import_job
).
to
be_nil
end
...
...
@@ -2080,7 +2080,7 @@ describe Project do
context
'with mirror'
do
it
'schedules RepositoryUpdateMirrorWorker'
do
project
=
create
(
:project
,
:mirror
)
project
=
create
(
:project
,
:mirror
,
:repository
)
expect
(
RepositoryUpdateMirrorWorker
).
to
receive
(
:perform_async
).
with
(
project
.
id
)
...
...
@@ -2188,8 +2188,8 @@ describe Project do
end
context
'with valid paths'
do
let!
(
:project1
)
{
create
(
:project
)
}
let!
(
:project2
)
{
create
(
:project
)
}
let!
(
:project1
)
{
create
(
:
empty_
project
)
}
let!
(
:project2
)
{
create
(
:
empty_
project
)
}
it
'returns the projects matching the paths'
do
projects
=
described_class
.
where_full_path_in
([
project1
.
full_path
,
...
...
@@ -2222,8 +2222,8 @@ describe Project do
end
describe
'#change_repository_storage'
do
let
(
:project
)
{
create
(
:project
,
repository_storage:
'a'
)
}
let
(
:read_only_project
)
{
create
(
:project
,
repository_storage:
'a'
,
repository_read_only:
true
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
repository_storage:
'a'
)
}
let
(
:read_only_project
)
{
create
(
:project
,
:repository
,
repository_storage:
'a'
,
repository_read_only:
true
)
}
before
do
FileUtils
.
mkdir
(
'tmp/tests/storage_a'
)
...
...
@@ -2336,7 +2336,7 @@ describe Project do
end
describe
'#repository_and_lfs_size'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:size
)
{
50
}
before
do
...
...
@@ -2355,7 +2355,7 @@ describe Project do
group
=
create
:group
group1
=
create
:group
project
=
create
:project
project
=
create
:
empty_
project
project
.
approver_group_ids
=
"
#{
group
.
id
}
,
#{
group1
.
id
}
"
project
.
save!
...
...
@@ -2506,7 +2506,7 @@ describe Project do
describe
'#create_mirror_data'
do
it
'it is called after save'
do
project
=
create
(
:project
)
project
=
create
(
:
empty_
project
)
expect
(
project
).
to
receive
(
:create_mirror_data
)
...
...
spec/models/remote_mirror_spec.rb
View file @
694f84e1
...
...
@@ -86,7 +86,7 @@ describe RemoteMirror do
end
context
'#sync'
do
let
(
:remote_mirror
)
{
create
(
:project
,
:remote_mirror
).
remote_mirrors
.
first
}
let
(
:remote_mirror
)
{
create
(
:project
,
:re
pository
,
:re
mote_mirror
).
remote_mirrors
.
first
}
before
do
Timecop
.
freeze
(
Time
.
now
)
...
...
@@ -142,7 +142,7 @@ describe RemoteMirror do
end
context
'#updated_since?'
do
let
(
:remote_mirror
)
{
create
(
:project
,
:remote_mirror
).
remote_mirrors
.
first
}
let
(
:remote_mirror
)
{
create
(
:project
,
:re
pository
,
:re
mote_mirror
).
remote_mirrors
.
first
}
let
(
:timestamp
)
{
Time
.
now
-
5
.
minutes
}
before
do
...
...
@@ -192,7 +192,7 @@ describe RemoteMirror do
end
def
create_mirror
(
params
)
project
=
FactoryGirl
.
create
(
:project
)
project
=
FactoryGirl
.
create
(
:project
,
:repository
)
project
.
remote_mirrors
.
create!
(
params
)
end
end
spec/models/repository_spec.rb
View file @
694f84e1
...
...
@@ -1422,8 +1422,8 @@ describe Repository do
describe
"class method find_commits_by_message_with_elastic"
do
it
"returns commits"
do
project
=
create
:project
project1
=
create
:project
project
=
create
:project
,
:repository
project1
=
create
:project
,
:repository
project
.
repository
.
index_commits
project1
.
repository
.
index_commits
...
...
@@ -1438,7 +1438,7 @@ describe Repository do
describe
"find_commits_by_message_with_elastic"
do
it
"returns commits"
do
project
=
create
:project
project
=
create
:project
,
:repository
project
.
repository
.
index_commits
...
...
spec/requests/api/members_spec.rb
View file @
694f84e1
...
...
@@ -185,7 +185,7 @@ describe API::Members do
context
'project in a group'
do
it
'returns a 405 method not allowed error when group membership lock is enabled'
do
group_with_membership_locked
=
create
(
:group
,
membership_lock:
true
)
project
=
create
(
:project
,
group:
group_with_membership_locked
)
project
=
create
(
:
empty_
project
,
group:
group_with_membership_locked
)
project
.
group
.
add_owner
(
master
)
post
api
(
"/projects/
#{
project
.
id
}
/members"
,
master
),
...
...
spec/requests/api/project_push_rule_spec.rb
View file @
694f84e1
...
...
@@ -4,7 +4,7 @@ describe API::ProjectPushRule, 'ProjectPushRule', api: true do
include
ApiHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:user3
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let!
(
:project
)
{
create
(
:project
,
:repository
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
before
do
project
.
team
<<
[
user
,
:master
]
...
...
spec/requests/api/v3/project_push_rule_spec.rb
View file @
694f84e1
...
...
@@ -4,7 +4,7 @@ describe API::V3::ProjectPushRule, 'ProjectPushRule', api: true do
include
ApiHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:user3
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let!
(
:project
)
{
create
(
:project
,
:repository
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
before
do
project
.
team
<<
[
user
,
:master
]
...
...
spec/requests/projects/mirrors_controller_spec.rb
View file @
694f84e1
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
Projects
::
MirrorsController
do
let
(
:project
)
do
create
(
:project
,
create
(
:project
,
:repository
,
mirror:
true
,
mirror_user:
user
,
import_url:
'http://user:pass@test.url'
)
...
...
spec/routing/webhook_routes_spec.rb
View file @
694f84e1
...
...
@@ -2,7 +2,7 @@ require "spec_helper"
describe
"routes to the proper webhooks controller"
,
type: :routing
do
context
'with a project context'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:project_hook
)
{
create
(
:project_hook
)
}
it
"routes the test action"
do
...
...
spec/services/ee/issues/build_service_spec.rb
View file @
694f84e1
...
...
@@ -11,7 +11,7 @@ describe Issues::BuildService do # rubocop:disable RSpec/FilePath
context
'with an issue template'
do
describe
'#execute'
do
it
'fills in the template in the description'
do
project
=
build
(
:project
,
issues_template:
'Work hard, play hard!'
)
project
=
build
(
:
empty_
project
,
issues_template:
'Work hard, play hard!'
)
service
=
described_class
.
new
(
project
,
user
)
issue
=
service
.
execute
...
...
spec/services/geo/move_repository_service_spec.rb
View file @
694f84e1
require
'spec_helper'
describe
Geo
::
MoveRepositoryService
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:new_path
)
{
project
.
full_path
+
'+renamed'
}
let
(
:full_new_path
)
{
File
.
join
(
project
.
repository_storage_path
,
new_path
)
}
subject
{
described_class
.
new
(
project
.
id
,
project
.
name
,
project
.
full_path
,
new_path
)
}
...
...
spec/services/geo/repository_updated_event_store_spec.rb
View file @
694f84e1
require
'spec_helper'
describe
Geo
::
RepositoryUpdatedEventStore
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:blankrev
)
{
Gitlab
::
Git
::
BLANK_SHA
}
let
(
:refs
)
{
[
'refs/heads/tést'
,
'refs/tags/tag'
]
}
...
...
spec/services/geo/schedule_repo_create_service_spec.rb
View file @
694f84e1
require
'spec_helper'
describe
Geo
::
ScheduleRepoCreateService
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
subject
{
described_class
.
new
(
project_id:
project
.
id
)
}
describe
'#execute'
do
...
...
spec/services/geo/schedule_repo_update_service_spec.rb
View file @
694f84e1
...
...
@@ -4,7 +4,7 @@ describe Geo::ScheduleRepoUpdateService do
include
RepoHelpers
let
(
:user
)
{
create
:user
}
let
(
:project
)
{
create
:project
}
let
(
:project
)
{
create
:project
,
:repository
}
let
(
:blankrev
)
{
Gitlab
::
Git
::
BLANK_SHA
}
let
(
:oldrev
)
{
sample_commit
.
parent_id
}
...
...
spec/services/git_push_service_spec.rb
View file @
694f84e1
...
...
@@ -15,7 +15,7 @@ describe GitPushService do
end
describe
'with remote mirrors'
do
let
(
:project
)
{
create
(
:project
,
:remote_mirror
)
}
let
(
:project
)
{
create
(
:project
,
:re
pository
,
:re
mote_mirror
)
}
subject
do
described_class
.
new
(
project
,
user
,
oldrev:
oldrev
,
newrev:
newrev
,
ref:
ref
)
...
...
spec/services/merge_requests/squash_service_spec.rb
View file @
694f84e1
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
MergeRequests
::
SquashService
do
let
(
:service
)
{
described_class
.
new
(
project
,
user
,
{})
}
let
(
:user
)
{
project
.
owner
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:merge_request_with_one_commit
)
do
create
(
:merge_request
,
...
...
spec/services/projects/destroy_service_spec.rb
View file @
694f84e1
...
...
@@ -65,7 +65,7 @@ describe Projects::DestroyService do
context
'when has remote mirrors'
do
let!
(
:project
)
do
create
(
:project
,
namespace:
user
.
namespace
).
tap
do
|
project
|
create
(
:project
,
:repository
,
namespace:
user
.
namespace
).
tap
do
|
project
|
project
.
remote_mirrors
.
create
(
url:
'http://test.com'
)
end
end
...
...
spec/services/projects/slack_application_install_service_spec.rb
View file @
694f84e1
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
Projects
::
SlackApplicationInstallService
do
let!
(
:user
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:project
)
{
create
(
:
empty_
project
)
}
def
service
(
params
=
{})
Projects
::
SlackApplicationInstallService
.
new
(
project
,
user
,
params
)
...
...
spec/services/projects/update_mirror_service_spec.rb
View file @
694f84e1
require
'spec_helper'
describe
Projects
::
UpdateMirrorService
do
let
(
:project
)
{
create
(
:project
,
:mirror
,
import_url:
Project
::
UNKNOWN_IMPORT_URL
)
}
let
(
:project
)
{
create
(
:project
,
:
repository
,
:
mirror
,
import_url:
Project
::
UNKNOWN_IMPORT_URL
)
}
describe
"#execute"
do
context
'unlicensed'
do
...
...
@@ -124,7 +124,7 @@ describe Projects::UpdateMirrorService do
end
describe
"when is no mirror"
do
let
(
:project
)
{
build_stubbed
(
:project
)
}
let
(
:project
)
{
build_stubbed
(
:
empty_
project
)
}
it
"success"
do
expect
(
project
.
mirror?
).
to
eq
(
false
)
...
...
spec/services/projects/update_remote_mirror_service_spec.rb
View file @
694f84e1
require
'spec_helper'
describe
Projects
::
UpdateRemoteMirrorService
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:remote_project
)
{
create
(
:forked_project_with_submodules
)
}
let
(
:repository
)
{
project
.
repository
}
let
(
:remote_mirror
)
{
project
.
remote_mirrors
.
create!
(
url:
remote_project
.
http_url_to_repo
,
enabled:
true
)
}
...
...
spec/services/projects/update_repository_storage_service_spec.rb
View file @
694f84e1
...
...
@@ -27,7 +27,7 @@ describe Projects::UpdateRepositoryStorageService do
end
context
'without wiki'
,
skip_gitaly_mock:
true
do
let
(
:project
)
{
create
(
:project
,
repository_storage:
'a'
,
repository_read_only:
true
,
wiki_enabled:
false
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
repository_storage:
'a'
,
repository_read_only:
true
,
wiki_enabled:
false
)
}
context
'when the move succeeds'
do
it
'moves the repository to the new storage and unmarks the repository as read only'
do
...
...
@@ -63,7 +63,7 @@ describe Projects::UpdateRepositoryStorageService do
end
context
'with wiki'
,
skip_gitaly_mock:
true
do
let
(
:project
)
{
create
(
:project
,
repository_storage:
'a'
,
repository_read_only:
true
,
wiki_enabled:
true
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
repository_storage:
'a'
,
repository_read_only:
true
,
wiki_enabled:
true
)
}
before
do
project
.
create_wiki
...
...
spec/services/projects/update_service_spec.rb
View file @
694f84e1
...
...
@@ -137,7 +137,7 @@ describe Projects::UpdateService, '#execute' do
describe
'repository_storage'
do
let
(
:admin_user
)
{
create
(
:user
,
admin:
true
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
repository_storage:
'a'
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
repository_storage:
'a'
)
}
let
(
:opts
)
{
{
repository_storage:
'b'
}
}
before
do
...
...
spec/services/slash_commands/global_slack_handler_spec.rb
View file @
694f84e1
require
'spec_helper'
describe
SlashCommands
::
GlobalSlackHandler
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:verification_token
)
{
'123'
}
...
...
spec/workers/admin_emails_worker_spec.rb
View file @
694f84e1
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
AdminEmailsWorker
do
context
"recipients"
do
let
(
:group
)
{
create
:group
}
let
(
:project
)
{
create
:project
}
let
(
:project
)
{
create
:
empty_
project
}
before
do
2
.
times
do
...
...
spec/workers/elastic_commit_indexer_worker_spec.rb
View file @
694f84e1
require
'spec_helper'
describe
ElasticCommitIndexerWorker
do
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:project
)
{
create
(
:project
,
:repository
)
}
subject
{
described_class
.
new
}
...
...
spec/workers/elastic_indexer_worker_spec.rb
View file @
694f84e1
...
...
@@ -174,7 +174,7 @@ describe ElasticIndexerWorker, elastic: true do
project
,
issue
,
milestone
,
note
,
merge_request
=
nil
Sidekiq
::
Testing
.
disable!
do
project
=
create
:project
project
=
create
:project
,
:repository
subject
.
perform
(
"index"
,
"Project"
,
project
.
id
)
issue
=
create
:issue
,
project:
project
...
...
spec/workers/geo_repository_create_worker_spec.rb
View file @
694f84e1
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
GeoRepositoryCreateWorker
do
let
(
:user
)
{
create
:user
}
let
(
:project
)
{
create
:project
}
let
(
:project
)
{
create
:project
,
:repository
}
let
(
:perform!
)
{
subject
.
perform
(
project
.
id
)
}
before
do
...
...
spec/workers/geo_repository_update_worker_spec.rb
View file @
694f84e1
...
...
@@ -4,7 +4,7 @@ describe GeoRepositoryUpdateWorker do
include
RepoHelpers
let
(
:user
)
{
create
:user
}
let
(
:project
)
{
create
:project
}
let
(
:project
)
{
create
:project
,
:repository
}
let
(
:blankrev
)
{
Gitlab
::
Git
::
BLANK_SHA
}
let
(
:oldrev
)
{
sample_commit
.
parent_id
}
...
...
spec/workers/project_update_repository_storage_worker_spec.rb
View file @
694f84e1
require
'spec_helper'
describe
ProjectUpdateRepositoryStorageWorker
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
subject
{
described_class
.
new
}
...
...
spec/workers/repository_update_mirror_worker_spec.rb
View file @
694f84e1
...
...
@@ -27,7 +27,7 @@ describe RepositoryUpdateMirrorWorker do
context
'with another worker already running'
do
it
'raises UpdateAlreadyInProgressError'
do
mirror
=
create
(
:project
,
:mirror
,
:import_started
)
mirror
=
create
(
:project
,
:
repository
,
:
mirror
,
:import_started
)
expect
do
subject
.
perform
(
mirror
.
id
)
...
...
@@ -37,7 +37,7 @@ describe RepositoryUpdateMirrorWorker do
context
'with unexpected error'
do
it
'marks mirror as failed'
do
mirror
=
create
(
:project
,
:mirror
,
:import_scheduled
)
mirror
=
create
(
:project
,
:
repository
,
:
mirror
,
:import_scheduled
)
allow_any_instance_of
(
Projects
::
UpdateMirrorService
).
to
receive
(
:execute
).
and_raise
(
RuntimeError
)
...
...
@@ -49,7 +49,7 @@ describe RepositoryUpdateMirrorWorker do
end
context
'threshold_reached?'
do
let
(
:mirror
)
{
create
(
:project
,
:mirror
,
:import_scheduled
)
}
let
(
:mirror
)
{
create
(
:project
,
:
repository
,
:
mirror
,
:import_scheduled
)
}
before
do
expect_any_instance_of
(
Projects
::
UpdateMirrorService
).
to
receive
(
:execute
).
and_return
(
status: :success
)
...
...
spec/workers/repository_update_remote_mirror_worker_spec.rb
View file @
694f84e1
...
...
@@ -3,7 +3,7 @@ require 'rails_helper'
describe
RepositoryUpdateRemoteMirrorWorker
do
subject
{
described_class
.
new
}
let
(
:remote_mirror
)
{
create
(
:project
,
:remote_mirror
).
remote_mirrors
.
first
}
let
(
:remote_mirror
)
{
create
(
:project
,
:re
pository
,
:re
mote_mirror
).
remote_mirrors
.
first
}
let
(
:scheduled_time
)
{
Time
.
now
-
5
.
minutes
}
before
do
...
...
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