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
Léo-Paul Géneau
gitlab-ce
Commits
9513bd18
Commit
9513bd18
authored
Aug 01, 2017
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure all project factories use `:repository` trait or `:empty_project`
parent
4c77c30f
Changes
115
Show whitespace changes
Inline
Side-by-side
Showing
115 changed files
with
214 additions
and
200 deletions
+214
-200
spec/controllers/admin/application_settings_controller_spec.rb
...controllers/admin/application_settings_controller_spec.rb
+1
-1
spec/controllers/admin/dashboard_controller_spec.rb
spec/controllers/admin/dashboard_controller_spec.rb
+2
-2
spec/controllers/autocomplete_controller_spec.rb
spec/controllers/autocomplete_controller_spec.rb
+8
-8
spec/controllers/dashboard_controller_spec.rb
spec/controllers/dashboard_controller_spec.rb
+1
-1
spec/controllers/projects/merge_requests/conflicts_controller_spec.rb
...lers/projects/merge_requests/conflicts_controller_spec.rb
+1
-1
spec/controllers/projects/merge_requests/creations_controller_spec.rb
...lers/projects/merge_requests/creations_controller_spec.rb
+2
-2
spec/controllers/projects/merge_requests/diffs_controller_spec.rb
...trollers/projects/merge_requests/diffs_controller_spec.rb
+2
-2
spec/controllers/projects/merge_requests_controller_spec.rb
spec/controllers/projects/merge_requests_controller_spec.rb
+4
-4
spec/controllers/projects/notes_controller_spec.rb
spec/controllers/projects/notes_controller_spec.rb
+2
-2
spec/controllers/projects/pipelines_controller_spec.rb
spec/controllers/projects/pipelines_controller_spec.rb
+1
-1
spec/controllers/projects/snippets_controller_spec.rb
spec/controllers/projects/snippets_controller_spec.rb
+1
-1
spec/controllers/projects_controller_spec.rb
spec/controllers/projects_controller_spec.rb
+7
-7
spec/controllers/snippets_controller_spec.rb
spec/controllers/snippets_controller_spec.rb
+1
-1
spec/factories/uploads.rb
spec/factories/uploads.rb
+1
-1
spec/features/dashboard/projects_spec.rb
spec/features/dashboard/projects_spec.rb
+2
-2
spec/features/discussion_comments/commit_spec.rb
spec/features/discussion_comments/commit_spec.rb
+1
-1
spec/features/discussion_comments/merge_request_spec.rb
spec/features/discussion_comments/merge_request_spec.rb
+1
-1
spec/features/issuables/markdown_references_spec.rb
spec/features/issuables/markdown_references_spec.rb
+1
-1
spec/features/projects/blobs/edit_spec.rb
spec/features/projects/blobs/edit_spec.rb
+1
-1
spec/features/reportable_note/commit_spec.rb
spec/features/reportable_note/commit_spec.rb
+1
-1
spec/features/reportable_note/merge_request_spec.rb
spec/features/reportable_note/merge_request_spec.rb
+1
-1
spec/finders/members_finder_spec.rb
spec/finders/members_finder_spec.rb
+1
-1
spec/helpers/button_helper_spec.rb
spec/helpers/button_helper_spec.rb
+1
-1
spec/helpers/ci_status_helper_spec.rb
spec/helpers/ci_status_helper_spec.rb
+1
-1
spec/helpers/diff_helper_spec.rb
spec/helpers/diff_helper_spec.rb
+1
-1
spec/helpers/issuables_helper_spec.rb
spec/helpers/issuables_helper_spec.rb
+2
-2
spec/helpers/markup_helper_spec.rb
spec/helpers/markup_helper_spec.rb
+1
-1
spec/helpers/notes_helper_spec.rb
spec/helpers/notes_helper_spec.rb
+1
-1
spec/helpers/projects_helper_spec.rb
spec/helpers/projects_helper_spec.rb
+3
-3
spec/javascripts/fixtures/balsamiq.rb
spec/javascripts/fixtures/balsamiq.rb
+1
-1
spec/javascripts/fixtures/dashboard.rb
spec/javascripts/fixtures/dashboard.rb
+1
-1
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/pdf.rb
spec/javascripts/fixtures/pdf.rb
+1
-1
spec/javascripts/fixtures/projects.rb
spec/javascripts/fixtures/projects.rb
+1
-1
spec/javascripts/fixtures/raw.rb
spec/javascripts/fixtures/raw.rb
+1
-1
spec/lib/banzai/filter/reference_filter_spec.rb
spec/lib/banzai/filter/reference_filter_spec.rb
+1
-1
spec/lib/container_registry/tag_spec.rb
spec/lib/container_registry/tag_spec.rb
+1
-1
spec/lib/gitlab/badge/coverage/report_spec.rb
spec/lib/gitlab/badge/coverage/report_spec.rb
+1
-1
spec/lib/gitlab/cache/ci/project_pipeline_status_spec.rb
spec/lib/gitlab/cache/ci/project_pipeline_status_spec.rb
+2
-2
spec/lib/gitlab/cycle_analytics/base_event_fetcher_spec.rb
spec/lib/gitlab/cycle_analytics/base_event_fetcher_spec.rb
+1
-1
spec/lib/gitlab/cycle_analytics/events_spec.rb
spec/lib/gitlab/cycle_analytics/events_spec.rb
+1
-1
spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb
...se/rename_reserved_paths_migration/v1/rename_base_spec.rb
+3
-3
spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_namespaces_spec.rb
...ame_reserved_paths_migration/v1/rename_namespaces_spec.rb
+6
-6
spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_projects_spec.rb
...ename_reserved_paths_migration/v1/rename_projects_spec.rb
+1
-1
spec/lib/gitlab/diff/parser_spec.rb
spec/lib/gitlab/diff/parser_spec.rb
+1
-1
spec/lib/gitlab/email/attachment_uploader_spec.rb
spec/lib/gitlab/email/attachment_uploader_spec.rb
+1
-1
spec/lib/gitlab/email/handler/create_issue_handler_spec.rb
spec/lib/gitlab/email/handler/create_issue_handler_spec.rb
+1
-1
spec/lib/gitlab/github_import/importer_spec.rb
spec/lib/gitlab/github_import/importer_spec.rb
+1
-1
spec/lib/gitlab/github_import/wiki_formatter_spec.rb
spec/lib/gitlab/github_import/wiki_formatter_spec.rb
+1
-1
spec/lib/gitlab/gl_repository_spec.rb
spec/lib/gitlab/gl_repository_spec.rb
+1
-1
spec/lib/gitlab/import_export/fork_spec.rb
spec/lib/gitlab/import_export/fork_spec.rb
+2
-2
spec/lib/gitlab/import_export/merge_request_parser_spec.rb
spec/lib/gitlab/import_export/merge_request_parser_spec.rb
+2
-2
spec/lib/gitlab/import_export/repo_restorer_spec.rb
spec/lib/gitlab/import_export/repo_restorer_spec.rb
+1
-1
spec/lib/gitlab/issuable_sorter_spec.rb
spec/lib/gitlab/issuable_sorter_spec.rb
+21
-21
spec/lib/gitlab/middleware/go_spec.rb
spec/lib/gitlab/middleware/go_spec.rb
+2
-2
spec/lib/gitlab/project_search_results_spec.rb
spec/lib/gitlab/project_search_results_spec.rb
+3
-3
spec/lib/gitlab/repo_path_spec.rb
spec/lib/gitlab/repo_path_spec.rb
+1
-1
spec/lib/gitlab/user_access_spec.rb
spec/lib/gitlab/user_access_spec.rb
+1
-1
spec/migrations/rename_system_namespaces_spec.rb
spec/migrations/rename_system_namespaces_spec.rb
+8
-8
spec/models/blob_viewer/composer_json_spec.rb
spec/models/blob_viewer/composer_json_spec.rb
+1
-1
spec/models/blob_viewer/gemspec_spec.rb
spec/models/blob_viewer/gemspec_spec.rb
+1
-1
spec/models/blob_viewer/gitlab_ci_yml_spec.rb
spec/models/blob_viewer/gitlab_ci_yml_spec.rb
+1
-1
spec/models/blob_viewer/package_json_spec.rb
spec/models/blob_viewer/package_json_spec.rb
+1
-1
spec/models/blob_viewer/podspec_json_spec.rb
spec/models/blob_viewer/podspec_json_spec.rb
+1
-1
spec/models/blob_viewer/podspec_spec.rb
spec/models/blob_viewer/podspec_spec.rb
+1
-1
spec/models/blob_viewer/route_map_spec.rb
spec/models/blob_viewer/route_map_spec.rb
+1
-1
spec/models/concerns/participable_spec.rb
spec/models/concerns/participable_spec.rb
+3
-3
spec/models/concerns/resolvable_note_spec.rb
spec/models/concerns/resolvable_note_spec.rb
+1
-1
spec/models/concerns/routable_spec.rb
spec/models/concerns/routable_spec.rb
+1
-1
spec/models/container_repository_spec.rb
spec/models/container_repository_spec.rb
+2
-2
spec/models/deployment_spec.rb
spec/models/deployment_spec.rb
+1
-1
spec/models/diff_discussion_spec.rb
spec/models/diff_discussion_spec.rb
+1
-1
spec/models/environment_spec.rb
spec/models/environment_spec.rb
+1
-1
spec/models/forked_project_link_spec.rb
spec/models/forked_project_link_spec.rb
+1
-1
spec/models/gpg_signature_spec.rb
spec/models/gpg_signature_spec.rb
+1
-1
spec/models/issue_spec.rb
spec/models/issue_spec.rb
+1
-1
spec/models/project_group_link_spec.rb
spec/models/project_group_link_spec.rb
+1
-1
spec/models/project_services/chat_notification_service_spec.rb
...models/project_services/chat_notification_service_spec.rb
+1
-1
spec/models/project_services/issue_tracker_service_spec.rb
spec/models/project_services/issue_tracker_service_spec.rb
+1
-1
spec/models/project_services/jira_service_spec.rb
spec/models/project_services/jira_service_spec.rb
+1
-1
spec/models/project_spec.rb
spec/models/project_spec.rb
+8
-8
spec/models/project_team_spec.rb
spec/models/project_team_spec.rb
+1
-1
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+1
-1
spec/models/sent_notification_spec.rb
spec/models/sent_notification_spec.rb
+2
-2
spec/policies/ci/build_policy_spec.rb
spec/policies/ci/build_policy_spec.rb
+1
-1
spec/policies/ci/pipeline_policy_spec.rb
spec/policies/ci/pipeline_policy_spec.rb
+1
-1
spec/policies/environment_policy_spec.rb
spec/policies/environment_policy_spec.rb
+4
-4
spec/presenters/merge_request_presenter_spec.rb
spec/presenters/merge_request_presenter_spec.rb
+1
-1
spec/requests/api/files_spec.rb
spec/requests/api/files_spec.rb
+2
-2
spec/requests/api/pipeline_schedules_spec.rb
spec/requests/api/pipeline_schedules_spec.rb
+1
-1
spec/requests/api/todos_spec.rb
spec/requests/api/todos_spec.rb
+1
-1
spec/requests/api/triggers_spec.rb
spec/requests/api/triggers_spec.rb
+1
-1
spec/requests/api/v3/files_spec.rb
spec/requests/api/v3/files_spec.rb
+1
-1
spec/requests/api/v3/project_hooks_spec.rb
spec/requests/api/v3/project_hooks_spec.rb
+2
-2
spec/requests/api/v3/triggers_spec.rb
spec/requests/api/v3/triggers_spec.rb
+1
-1
spec/requests/lfs_http_spec.rb
spec/requests/lfs_http_spec.rb
+3
-3
spec/requests/request_profiler_spec.rb
spec/requests/request_profiler_spec.rb
+1
-1
spec/services/ci/create_pipeline_service_spec.rb
spec/services/ci/create_pipeline_service_spec.rb
+1
-1
spec/services/ci/play_build_service_spec.rb
spec/services/ci/play_build_service_spec.rb
+1
-1
spec/services/labels/create_service_spec.rb
spec/services/labels/create_service_spec.rb
+2
-2
spec/services/labels/update_service_spec.rb
spec/services/labels/update_service_spec.rb
+1
-1
spec/services/milestones/destroy_service_spec.rb
spec/services/milestones/destroy_service_spec.rb
+1
-1
spec/services/users/destroy_service_spec.rb
spec/services/users/destroy_service_spec.rb
+2
-2
spec/services/users/migrate_to_ghost_user_service_spec.rb
spec/services/users/migrate_to_ghost_user_service_spec.rb
+1
-1
spec/support/features/issuable_slash_commands_shared_examples.rb
...pport/features/issuable_slash_commands_shared_examples.rb
+8
-1
spec/support/import_export/export_file_helper.rb
spec/support/import_export/export_file_helper.rb
+1
-1
spec/support/services/migrate_to_ghost_user_service_shared_examples.rb
...services/migrate_to_ghost_user_service_shared_examples.rb
+8
-1
spec/uploaders/file_uploader_spec.rb
spec/uploaders/file_uploader_spec.rb
+1
-1
spec/validators/dynamic_path_validator_spec.rb
spec/validators/dynamic_path_validator_spec.rb
+1
-1
spec/views/layouts/nav/_project.html.haml_spec.rb
spec/views/layouts/nav/_project.html.haml_spec.rb
+1
-1
spec/views/notify/pipeline_failed_email.html.haml_spec.rb
spec/views/notify/pipeline_failed_email.html.haml_spec.rb
+1
-1
spec/views/notify/pipeline_success_email.html.haml_spec.rb
spec/views/notify/pipeline_success_email.html.haml_spec.rb
+1
-1
spec/workers/create_gpg_signature_worker_spec.rb
spec/workers/create_gpg_signature_worker_spec.rb
+2
-2
spec/workers/process_commit_worker_spec.rb
spec/workers/process_commit_worker_spec.rb
+1
-1
No files found.
spec/controllers/admin/application_settings_controller_spec.rb
View file @
9513bd18
...
...
@@ -4,7 +4,7 @@ describe Admin::ApplicationSettingsController do
include
StubENV
let
(
:group
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
namespace:
group
)
}
let
(
:admin
)
{
create
(
:admin
)
}
let
(
:user
)
{
create
(
:user
)}
...
...
spec/controllers/admin/dashboard_controller_spec.rb
View file @
9513bd18
...
...
@@ -8,8 +8,8 @@ describe Admin::DashboardController do
it
'does not retrieve projects that are pending deletion'
do
sign_in
(
create
(
:admin
))
project
=
create
(
:project
)
pending_delete_project
=
create
(
:project
,
pending_delete:
true
)
project
=
create
(
:
empty_
project
)
pending_delete_project
=
create
(
:
empty_
project
,
pending_delete:
true
)
get
:index
...
...
spec/controllers/autocomplete_controller_spec.rb
View file @
9513bd18
...
...
@@ -65,7 +65,7 @@ describe AutocompleteController do
end
context
'non-member login for public project'
do
let!
(
:project
)
{
create
(
:project
,
:public
)
}
let!
(
:project
)
{
create
(
:
empty_
project
,
:public
)
}
before
do
sign_in
(
non_member
)
...
...
@@ -127,7 +127,7 @@ describe AutocompleteController do
end
context
'unauthenticated user'
do
let
(
:public_project
)
{
create
(
:project
,
:public
)
}
let
(
:public_project
)
{
create
(
:
empty_
project
,
:public
)
}
let
(
:body
)
{
JSON
.
parse
(
response
.
body
)
}
describe
'GET #users with public project'
do
...
...
@@ -231,8 +231,8 @@ describe AutocompleteController do
end
context
'GET projects'
do
let
(
:authorized_project
)
{
create
(
:project
)
}
let
(
:authorized_search_project
)
{
create
(
:project
,
name:
'rugged'
)
}
let
(
:authorized_project
)
{
create
(
:
empty_
project
)
}
let
(
:authorized_search_project
)
{
create
(
:
empty_
project
,
name:
'rugged'
)
}
before
do
sign_in
(
user
)
...
...
@@ -289,8 +289,8 @@ describe AutocompleteController do
context
'authorized projects apply limit'
do
before
do
authorized_project2
=
create
(
:project
)
authorized_project3
=
create
(
:project
)
authorized_project2
=
create
(
:
empty_
project
)
authorized_project3
=
create
(
:
empty_
project
)
authorized_project
.
add_master
(
user
)
authorized_project2
.
add_master
(
user
)
...
...
@@ -315,8 +315,8 @@ describe AutocompleteController do
context
'authorized projects with offset'
do
before
do
authorized_project2
=
create
(
:project
)
authorized_project3
=
create
(
:project
)
authorized_project2
=
create
(
:
empty_
project
)
authorized_project3
=
create
(
:
empty_
project
)
authorized_project
.
add_master
(
user
)
authorized_project2
.
add_master
(
user
)
...
...
spec/controllers/dashboard_controller_spec.rb
View file @
9513bd18
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
DashboardController
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
before
do
project
.
team
<<
[
user
,
:master
]
...
...
spec/controllers/projects/merge_requests/conflicts_controller_spec.rb
View file @
9513bd18
require
'spec_helper'
describe
Projects
::
MergeRequests
::
ConflictsController
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:merge_request
)
{
create
(
:merge_request_with_diffs
,
target_project:
project
,
source_project:
project
)
}
let
(
:merge_request_with_conflicts
)
do
...
...
spec/controllers/projects/merge_requests/creations_controller_spec.rb
View file @
9513bd18
require
'spec_helper'
describe
Projects
::
MergeRequests
::
CreationsController
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:fork_project
)
{
create
(
:forked_project_with_submodules
)
}
...
...
@@ -83,7 +83,7 @@ describe Projects::MergeRequests::CreationsController do
end
context
'when the source branch is in a different project to the target'
do
let
(
:other_project
)
{
create
(
:project
)
}
let
(
:other_project
)
{
create
(
:project
,
:repository
)
}
before
do
other_project
.
team
<<
[
user
,
:master
]
...
...
spec/controllers/projects/merge_requests/diffs_controller_spec.rb
View file @
9513bd18
require
'spec_helper'
describe
Projects
::
MergeRequests
::
DiffsController
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:merge_request
)
{
create
(
:merge_request_with_diffs
,
target_project:
project
,
source_project:
project
)
}
...
...
@@ -36,7 +36,7 @@ describe Projects::MergeRequests::DiffsController do
context
'with forked projects with submodules'
do
render_views
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:fork_project
)
{
create
(
:forked_project_with_submodules
)
}
let
(
:merge_request
)
{
create
(
:merge_request_with_diffs
,
source_project:
fork_project
,
source_branch:
'add-submodule-version-bump'
,
target_branch:
'master'
,
target_project:
project
)
}
...
...
spec/controllers/projects/merge_requests_controller_spec.rb
View file @
9513bd18
require
'spec_helper'
describe
Projects
::
MergeRequestsController
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:merge_request
)
{
create
(
:merge_request_with_diffs
,
target_project:
project
,
source_project:
project
)
}
let
(
:merge_request_with_conflicts
)
do
...
...
@@ -191,7 +191,7 @@ describe Projects::MergeRequestsController do
end
context
'there is no source project'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:fork_project
)
{
create
(
:forked_project_with_submodules
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
fork_project
,
source_branch:
'add-submodule-version-bump'
,
target_branch:
'master'
,
target_project:
project
)
}
...
...
@@ -429,7 +429,7 @@ describe Projects::MergeRequestsController do
context
"when the user is owner"
do
let
(
:owner
)
{
create
(
:user
)
}
let
(
:namespace
)
{
create
(
:namespace
,
owner:
owner
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
namespace
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
namespace
)
}
before
do
sign_in
owner
...
...
@@ -587,7 +587,7 @@ describe Projects::MergeRequestsController do
describe
'GET ci_environments_status'
do
context
'the environment is from a forked project'
do
let!
(
:forked
)
{
create
(
:project
)
}
let!
(
:forked
)
{
create
(
:project
,
:repository
)
}
let!
(
:environment
)
{
create
(
:environment
,
project:
forked
)
}
let!
(
:deployment
)
{
create
(
:deployment
,
environment:
environment
,
sha:
forked
.
commit
.
id
,
ref:
'master'
)
}
let
(
:admin
)
{
create
(
:admin
)
}
...
...
spec/controllers/projects/notes_controller_spec.rb
View file @
9513bd18
...
...
@@ -167,10 +167,10 @@ describe Projects::NotesController do
end
context
'when creating a commit comment from an MR fork'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:fork_project
)
do
create
(
:project
).
tap
do
|
fork
|
create
(
:project
,
:repository
).
tap
do
|
fork
|
create
(
:forked_project_link
,
forked_to_project:
fork
,
forked_from_project:
project
)
end
end
...
...
spec/controllers/projects/pipelines_controller_spec.rb
View file @
9513bd18
...
...
@@ -61,7 +61,7 @@ describe Projects::PipelinesController do
create_build
(
'post deploy'
,
3
,
'pages 0'
)
end
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:pipeline
)
do
create
(
:ci_empty_pipeline
,
project:
project
,
user:
user
,
sha:
project
.
commit
.
id
)
end
...
...
spec/controllers/projects/snippets_controller_spec.rb
View file @
9513bd18
...
...
@@ -156,7 +156,7 @@ describe Projects::SnippetsController do
end
describe
'PUT #update'
do
let
(
:project
)
{
create
:project
,
:public
}
let
(
:project
)
{
create
:
empty_
project
,
:public
}
let
(
:snippet
)
{
create
:project_snippet
,
author:
user
,
project:
project
,
visibility_level:
visibility_level
}
def
update_snippet
(
snippet_params
=
{},
additional_params
=
{})
...
...
spec/controllers/projects_controller_spec.rb
View file @
9513bd18
...
...
@@ -196,7 +196,7 @@ describe ProjectsController do
context
"redirection from http://someproject.git"
do
it
'redirects to project page (format.html)'
do
project
=
create
(
:project
,
:public
)
project
=
create
(
:
empty_
project
,
:public
)
get
:show
,
namespace_id:
project
.
namespace
,
id:
project
,
format: :git
...
...
@@ -254,7 +254,7 @@ describe ProjectsController do
describe
'#transfer'
do
render_views
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:admin
)
{
create
(
:admin
)
}
let
(
:new_namespace
)
{
create
(
:namespace
)
}
...
...
@@ -311,8 +311,8 @@ describe ProjectsController do
end
context
"when the project is forked"
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:fork_project
)
{
create
(
:project
,
forked_from_project:
project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:fork_project
)
{
create
(
:project
,
:repository
,
forked_from_project:
project
)
}
let
(
:merge_request
)
do
create
(
:merge_request
,
source_project:
fork_project
,
...
...
@@ -390,7 +390,7 @@ describe ProjectsController do
end
context
'with forked project'
do
let
(
:project_fork
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
let
(
:project_fork
)
{
create
(
:project
,
:repository
,
namespace:
user
.
namespace
)
}
before
do
create
(
:forked_project_link
,
forked_to_project:
project_fork
)
...
...
@@ -408,7 +408,7 @@ describe ProjectsController do
end
context
'when project not forked'
do
let
(
:unforked_project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
let
(
:unforked_project
)
{
create
(
:
empty_
project
,
namespace:
user
.
namespace
)
}
it
'does nothing if project was not forked'
do
delete
(
:remove_fork
,
...
...
@@ -430,7 +430,7 @@ describe ProjectsController do
end
describe
"GET refs"
do
let
(
:public_project
)
{
create
(
:project
,
:public
)
}
let
(
:public_project
)
{
create
(
:project
,
:public
,
:repository
)
}
it
"gets a list of branches and tags"
do
get
:refs
,
namespace_id:
public_project
.
namespace
,
id:
public_project
...
...
spec/controllers/snippets_controller_spec.rb
View file @
9513bd18
...
...
@@ -273,7 +273,7 @@ describe SnippetsController do
end
describe
'PUT #update'
do
let
(
:project
)
{
create
:project
}
let
(
:project
)
{
create
:
empty_
project
}
let
(
:snippet
)
{
create
:personal_snippet
,
author:
user
,
project:
project
,
visibility_level:
visibility_level
}
def
update_snippet
(
snippet_params
=
{},
additional_params
=
{})
...
...
spec/factories/uploads.rb
View file @
9513bd18
FactoryGirl
.
define
do
factory
:upload
do
model
{
build
(
:project
)
}
model
{
build
(
:
empty_
project
)
}
path
{
"uploads/-/system/project/avatar/avatar.jpg"
}
size
100
.
kilobytes
uploader
"AvatarUploader"
...
...
spec/features/dashboard/projects_spec.rb
View file @
9513bd18
...
...
@@ -2,8 +2,8 @@ require 'spec_helper'
feature
'Dashboard Projects'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
name:
'awesome stuff'
)
}
let
(
:project2
)
{
create
(
:project
,
:public
,
name:
'Community project'
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
name:
'awesome stuff'
)
}
let
(
:project2
)
{
create
(
:
empty_
project
,
:public
,
name:
'Community project'
)
}
before
do
project
.
team
<<
[
user
,
:developer
]
...
...
spec/features/discussion_comments/commit_spec.rb
View file @
9513bd18
...
...
@@ -4,7 +4,7 @@ describe 'Discussion Comments Merge Request', :js do
include
RepoHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
before
do
...
...
spec/features/discussion_comments/merge_request_spec.rb
View file @
9513bd18
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
'Discussion Comments Merge Request'
,
:js
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
before
do
...
...
spec/features/issuables/markdown_references_spec.rb
View file @
9513bd18
...
...
@@ -2,7 +2,7 @@ require 'rails_helper'
describe
'Markdown References'
,
:js
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:actual_project
)
{
create
(
:project
,
:public
)
}
let
(
:actual_project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
target_project:
actual_project
,
source_project:
actual_project
)}
let
(
:issue_actual_project
)
{
create
(
:issue
,
project:
actual_project
)
}
let!
(
:other_project
)
{
create
(
:empty_project
,
:public
)
}
...
...
spec/features/projects/blobs/edit_spec.rb
View file @
9513bd18
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
feature
'Editing file blob'
,
js:
true
do
include
TreeHelper
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
source_branch:
'feature'
,
target_branch:
'master'
)
}
let
(
:branch
)
{
'master'
}
let
(
:file_path
)
{
project
.
repository
.
ls_files
(
project
.
repository
.
root_ref
)[
1
]
}
...
...
spec/features/reportable_note/commit_spec.rb
View file @
9513bd18
...
...
@@ -4,7 +4,7 @@ describe 'Reportable note on commit', :js do
include
RepoHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
before
do
project
.
add_master
(
user
)
...
...
spec/features/reportable_note/merge_request_spec.rb
View file @
9513bd18
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
'Reportable note on merge request'
,
:js
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
before
do
...
...
spec/finders/members_finder_spec.rb
View file @
9513bd18
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
MembersFinder
,
'#execute'
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:nested_group
)
{
create
(
:group
,
:access_requestable
,
parent:
group
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
nested_group
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
namespace:
nested_group
)
}
let
(
:user1
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user3
)
{
create
(
:user
)
}
...
...
spec/helpers/button_helper_spec.rb
View file @
9513bd18
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
ButtonHelper
do
describe
'http_clone_button'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:
project
)
}
let
(
:project
)
{
build_stubbed
(
:empty_
project
)
}
let
(
:has_tooltip_class
)
{
'has-tooltip'
}
def
element
...
...
spec/helpers/ci_status_helper_spec.rb
View file @
9513bd18
...
...
@@ -48,7 +48,7 @@ describe CiStatusHelper do
describe
"#pipeline_status_cache_key"
do
it
"builds a cache key for pipeline status"
do
pipeline_status
=
Gitlab
::
Cache
::
Ci
::
ProjectPipelineStatus
.
new
(
build
(
:
project
),
build
_stubbed
(
:empty_
project
),
pipeline_info:
{
sha:
"123abc"
,
status:
"success"
...
...
spec/helpers/diff_helper_spec.rb
View file @
9513bd18
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
DiffHelper
do
include
RepoHelpers
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:repository
)
{
project
.
repository
}
let
(
:commit
)
{
project
.
commit
(
sample_commit
.
id
)
}
let
(
:diffs
)
{
commit
.
raw_diffs
}
...
...
spec/helpers/issuables_helper_spec.rb
View file @
9513bd18
...
...
@@ -180,7 +180,7 @@ describe IssuablesHelper do
context
'when show_full_reference falsey'
do
context
'when @group present'
do
it
'display issuable reference to @group'
do
project
=
build_stubbed
(
:project
)
project
=
build_stubbed
(
:
empty_
project
)
assign
(
:show_full_reference
,
nil
)
assign
(
:group
,
project
.
namespace
)
...
...
@@ -193,7 +193,7 @@ describe IssuablesHelper do
context
'when @project present'
do
it
'display issuable reference to @project'
do
project
=
build_stubbed
(
:project
)
project
=
build_stubbed
(
:
empty_
project
)
assign
(
:show_full_reference
,
nil
)
assign
(
:group
,
nil
)
...
...
spec/helpers/markup_helper_spec.rb
View file @
9513bd18
...
...
@@ -42,7 +42,7 @@ describe MarkupHelper do
describe
"override default project"
do
let
(
:actual
)
{
issue
.
to_reference
}
let
(
:second_project
)
{
create
(
:project
,
:public
)
}
let
(
:second_project
)
{
create
(
:
empty_
project
,
:public
)
}
let
(
:second_issue
)
{
create
(
:issue
,
project:
second_project
)
}
it
'links to the issue'
do
...
...
spec/helpers/notes_helper_spec.rb
View file @
9513bd18
...
...
@@ -40,7 +40,7 @@ describe NotesHelper do
end
describe
'#discussion_path'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
context
'for a merge request discusion'
do
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
target_project:
project
,
importing:
true
)
}
...
...
spec/helpers/projects_helper_spec.rb
View file @
9513bd18
...
...
@@ -46,7 +46,7 @@ describe ProjectsHelper do
end
describe
"readme_cache_key"
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
before
do
helper
.
instance_variable_set
(
:@project
,
project
)
...
...
@@ -64,7 +64,7 @@ describe ProjectsHelper do
end
describe
"#project_list_cache_key"
,
clean_gitlab_redis_shared_state:
true
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
it
"includes the route"
do
expect
(
helper
.
project_list_cache_key
(
project
)).
to
include
(
project
.
route
.
cache_key
)
...
...
@@ -251,7 +251,7 @@ describe ProjectsHelper do
end
describe
'#sanitized_import_error'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
before
do
allow
(
project
).
to
receive
(
:repository_storage_path
).
and_return
(
'/base/repo/path'
)
...
...
spec/javascripts/fixtures/balsamiq.rb
View file @
9513bd18
...
...
@@ -4,7 +4,7 @@ describe 'Balsamiq file', '(JavaScript fixtures)', type: :controller do
include
JavaScriptFixturesHelpers
let
(
:namespace
)
{
create
(
:namespace
,
name:
'frontend-fixtures'
)}
let
(
:project
)
{
create
(
:project
,
namespace:
namespace
,
path:
'balsamiq-project'
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
namespace
,
path:
'balsamiq-project'
)
}
before
(
:all
)
do
clean_frontend_fixtures
(
'blob/balsamiq/'
)
...
...
spec/javascripts/fixtures/dashboard.rb
View file @
9513bd18
...
...
@@ -5,7 +5,7 @@ describe Dashboard::ProjectsController, '(JavaScript fixtures)', type: :controll
let
(
:admin
)
{
create
(
:admin
)
}
let
(
:namespace
)
{
create
(
:namespace
,
name:
'frontend-fixtures'
)}
let
(
:project
)
{
create
(
:project
,
namespace:
namespace
,
path:
'builds-project'
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
namespace:
namespace
,
path:
'builds-project'
)
}
render_views
...
...
spec/javascripts/fixtures/merge_requests.rb
View file @
9513bd18
...
...
@@ -5,7 +5,7 @@ describe Projects::MergeRequestsController, '(JavaScript fixtures)', type: :cont
let
(
:admin
)
{
create
(
:admin
)
}
let
(
:namespace
)
{
create
(
:namespace
,
name:
'frontend-fixtures'
)}
let
(
:project
)
{
create
(
:project
,
namespace:
namespace
,
path:
'merge-requests-project'
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
namespace
,
path:
'merge-requests-project'
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
:with_diffs
,
source_project:
project
,
target_project:
project
,
description:
'- [ ] Task List Item'
)
}
let
(
:merged_merge_request
)
{
create
(
:merge_request
,
:merged
,
source_project:
project
,
target_project:
project
)
}
let
(
:pipeline
)
do
...
...
spec/javascripts/fixtures/merge_requests_diffs.rb
View file @
9513bd18
...
...
@@ -6,7 +6,7 @@ describe Projects::MergeRequests::DiffsController, '(JavaScript fixtures)', type
let
(
:admin
)
{
create
(
:admin
)
}
let
(
:namespace
)
{
create
(
:namespace
,
name:
'frontend-fixtures'
)}
let
(
:project
)
{
create
(
:project
,
namespace:
namespace
,
path:
'merge-requests-project'
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
namespace
,
path:
'merge-requests-project'
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
:with_diffs
,
source_project:
project
,
target_project:
project
,
description:
'- [ ] Task List Item'
)
}
let
(
:path
)
{
"files/ruby/popen.rb"
}
let
(
:position
)
do
...
...
spec/javascripts/fixtures/pdf.rb
View file @
9513bd18
...
...
@@ -4,7 +4,7 @@ describe 'PDF file', '(JavaScript fixtures)', type: :controller do
include
JavaScriptFixturesHelpers
let
(
:namespace
)
{
create
(
:namespace
,
name:
'frontend-fixtures'
)}
let
(
:project
)
{
create
(
:project
,
namespace:
namespace
,
path:
'pdf-project'
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
namespace
,
path:
'pdf-project'
)
}
before
(
:all
)
do
clean_frontend_fixtures
(
'blob/pdf/'
)
...
...
spec/javascripts/fixtures/projects.rb
View file @
9513bd18
...
...
@@ -5,7 +5,7 @@ describe ProjectsController, '(JavaScript fixtures)', type: :controller do
let
(
:admin
)
{
create
(
:admin
)
}
let
(
:namespace
)
{
create
(
:namespace
,
name:
'frontend-fixtures'
)}
let
(
:project
)
{
create
(
:project
,
namespace:
namespace
,
path:
'builds-project'
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
namespace:
namespace
,
path:
'builds-project'
)
}
render_views
...
...
spec/javascripts/fixtures/raw.rb
View file @
9513bd18
...
...
@@ -4,7 +4,7 @@ describe 'Raw files', '(JavaScript fixtures)', type: :controller do
include
JavaScriptFixturesHelpers
let
(
:namespace
)
{
create
(
:namespace
,
name:
'frontend-fixtures'
)}
let
(
:project
)
{
create
(
:project
,
namespace:
namespace
,
path:
'raw-project'
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
namespace
,
path:
'raw-project'
)
}
before
(
:all
)
do
clean_frontend_fixtures
(
'blob/notebook/'
)
...
...
spec/lib/banzai/filter/reference_filter_spec.rb
View file @
9513bd18
require
'spec_helper'
describe
Banzai
::
Filter
::
ReferenceFilter
do
let
(
:project
)
{
build
(
:
project
)
}
let
(
:project
)
{
build
_stubbed
(
:empty_
project
)
}
describe
'#each_node'
do
it
'iterates over the nodes in a document'
do
...
...
spec/lib/container_registry/tag_spec.rb
View file @
9513bd18
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
ContainerRegistry
::
Tag
do
let
(
:group
)
{
create
(
:group
,
name:
'group'
)
}
let
(
:project
)
{
create
(
:project
,
path:
'test'
,
group:
group
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
path:
'test'
,
group:
group
)
}
let
(
:repository
)
do
create
(
:container_repository
,
name:
''
,
project:
project
)
...
...
spec/lib/gitlab/badge/coverage/report_spec.rb
View file @
9513bd18
require
'spec_helper'
describe
Gitlab
::
Badge
::
Coverage
::
Report
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:job_name
)
{
nil
}
let
(
:badge
)
do
...
...
spec/lib/gitlab/cache/ci/project_pipeline_status_spec.rb
View file @
9513bd18
require
'spec_helper'
describe
Gitlab
::
Cache
::
Ci
::
ProjectPipelineStatus
,
:clean_gitlab_redis_cache
do
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:pipeline_status
)
{
described_class
.
new
(
project
)
}
let
(
:cache_key
)
{
"projects/
#{
project
.
id
}
/pipeline_status"
}
...
...
@@ -18,7 +18,7 @@ describe Gitlab::Cache::Ci::ProjectPipelineStatus, :clean_gitlab_redis_cache do
let
(
:sha
)
{
'424d1b73bc0d3cb726eb7dc4ce17a4d48552f8c6'
}
let
(
:ref
)
{
'master'
}
let
(
:pipeline_info
)
{
{
sha:
sha
,
status:
status
,
ref:
ref
}
}
let!
(
:project_without_status
)
{
create
(
:project
)
}
let!
(
:project_without_status
)
{
create
(
:project
,
:repository
)
}
describe
'.load_in_batch_for_projects'
do
it
'preloads pipeline_status on projects'
do
...
...
spec/lib/gitlab/cycle_analytics/base_event_fetcher_spec.rb
View file @
9513bd18
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
Gitlab
::
CycleAnalytics
::
BaseEventFetcher
do
let
(
:max_events
)
{
2
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
create
(
:user
,
:admin
)
}
let
(
:start_time_attrs
)
{
Issue
.
arel_table
[
:created_at
]
}
let
(
:end_time_attrs
)
{
[
Issue
::
Metrics
.
arel_table
[
:first_associated_with_milestone_at
]]
}
...
...
spec/lib/gitlab/cycle_analytics/events_spec.rb
View file @
9513bd18
require
'spec_helper'
describe
'cycle analytics events'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:from_date
)
{
10
.
days
.
ago
}
let
(
:user
)
{
create
(
:user
,
:admin
)
}
let!
(
:context
)
{
create
(
:issue
,
project:
project
,
created_at:
2
.
days
.
ago
)
}
...
...
spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb
View file @
9513bd18
...
...
@@ -94,7 +94,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase, :trunca
end
it
"renames the route for projects of the namespace"
do
project
=
create
(
:project
,
path:
"project-path"
,
namespace:
namespace
)
project
=
create
(
:project
,
:repository
,
path:
"project-path"
,
namespace:
namespace
)
subject
.
rename_path_for_routable
(
migration_namespace
(
namespace
))
...
...
@@ -120,7 +120,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase, :trunca
context
"the-path namespace -> subgroup -> the-path0 project"
do
it
"updates the route of the project correctly"
do
subgroup
=
create
(
:group
,
path:
"subgroup"
,
parent:
namespace
)
project
=
create
(
:project
,
path:
"the-path0"
,
namespace:
subgroup
)
project
=
create
(
:project
,
:repository
,
path:
"the-path0"
,
namespace:
subgroup
)
subject
.
rename_path_for_routable
(
migration_namespace
(
namespace
))
...
...
@@ -165,7 +165,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase, :trunca
it
'renames all the routes for the namespace'
do
child
=
create
(
:group
,
path:
'child'
,
parent:
namespace
)
project
=
create
(
:project
,
namespace:
child
,
path:
'the-project'
)
project
=
create
(
:project
,
:repository
,
namespace:
child
,
path:
'the-project'
)
other_one
=
create
(
:namespace
,
path:
'the-path-is-similar'
)
subject
.
perform_rename
(
migration_namespace
(
namespace
),
'the-path'
,
'renamed'
)
...
...
spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_namespaces_spec.rb
View file @
9513bd18
...
...
@@ -94,7 +94,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameNamespaces, :
describe
'#move_repositories'
do
let
(
:namespace
)
{
create
(
:group
,
name:
'hello-group'
)
}
it
'moves a project for a namespace'
do
create
(
:project
,
namespace:
namespace
,
path:
'hello-project'
)
create
(
:project
,
:repository
,
namespace:
namespace
,
path:
'hello-project'
)
expected_path
=
File
.
join
(
TestEnv
.
repos_path
,
'bye-group'
,
'hello-project.git'
)
subject
.
move_repositories
(
namespace
,
'hello-group'
,
'bye-group'
)
...
...
@@ -104,7 +104,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameNamespaces, :
it
'moves a namespace in a subdirectory correctly'
do
child_namespace
=
create
(
:group
,
name:
'sub-group'
,
parent:
namespace
)
create
(
:project
,
namespace:
child_namespace
,
path:
'hello-project'
)
create
(
:project
,
:repository
,
namespace:
child_namespace
,
path:
'hello-project'
)
expected_path
=
File
.
join
(
TestEnv
.
repos_path
,
'hello-group'
,
'renamed-sub-group'
,
'hello-project.git'
)
...
...
@@ -115,7 +115,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameNamespaces, :
it
'moves a parent namespace with subdirectories'
do
child_namespace
=
create
(
:group
,
name:
'sub-group'
,
parent:
namespace
)
create
(
:project
,
namespace:
child_namespace
,
path:
'hello-project'
)
create
(
:project
,
:repository
,
namespace:
child_namespace
,
path:
'hello-project'
)
expected_path
=
File
.
join
(
TestEnv
.
repos_path
,
'renamed-group'
,
'sub-group'
,
'hello-project.git'
)
subject
.
move_repositories
(
child_namespace
,
'hello-group'
,
'renamed-group'
)
...
...
@@ -166,7 +166,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameNamespaces, :
describe
'#rename_namespace_dependencies'
do
it
"moves the the repository for a project in the namespace"
do
create
(
:project
,
namespace:
namespace
,
path:
"the-path-project"
)
create
(
:project
,
:repository
,
namespace:
namespace
,
path:
"the-path-project"
)
expected_repo
=
File
.
join
(
TestEnv
.
repos_path
,
"the-path0"
,
"the-path-project.git"
)
subject
.
rename_namespace_dependencies
(
namespace
,
'the-path'
,
'the-path0'
)
...
...
@@ -243,7 +243,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameNamespaces, :
describe
'#revert_renames'
,
redis:
true
do
it
'renames the routes back to the previous values'
do
project
=
create
(
:project
,
path:
'a-project'
,
namespace:
namespace
)
project
=
create
(
:project
,
:repository
,
path:
'a-project'
,
namespace:
namespace
)
subject
.
rename_namespace
(
namespace
)
expect
(
subject
).
to
receive
(
:perform_rename
)
...
...
@@ -261,7 +261,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameNamespaces, :
end
it
'moves the repositories back to their original place'
do
project
=
create
(
:project
,
path:
'a-project'
,
namespace:
namespace
)
project
=
create
(
:project
,
:repository
,
path:
'a-project'
,
namespace:
namespace
)
project
.
create_repository
subject
.
rename_namespace
(
namespace
)
...
...
spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_projects_spec.rb
View file @
9513bd18
...
...
@@ -104,7 +104,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameProjects, :tr
describe
'#move_repository'
do
let
(
:known_parent
)
{
create
(
:namespace
,
path:
'known-parent'
)
}
let
(
:project
)
{
create
(
:project
,
path:
'the-path'
,
namespace:
known_parent
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
path:
'the-path'
,
namespace:
known_parent
)
}
it
'moves the repository for a project'
do
expected_path
=
File
.
join
(
TestEnv
.
repos_path
,
'known-parent'
,
'new-repo.git'
)
...
...
spec/lib/gitlab/diff/parser_spec.rb
View file @
9513bd18
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
Gitlab
::
Diff
::
Parser
do
include
RepoHelpers
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:commit
)
{
project
.
commit
(
sample_commit
.
id
)
}
let
(
:diff
)
{
commit
.
raw_diffs
.
first
}
let
(
:parser
)
{
described_class
.
new
}
...
...
spec/lib/gitlab/email/attachment_uploader_spec.rb
View file @
9513bd18
...
...
@@ -2,7 +2,7 @@ require "spec_helper"
describe
Gitlab
::
Email
::
AttachmentUploader
do
describe
"#execute"
do
let
(
:project
)
{
build
(
:project
)
}
let
(
:project
)
{
build
(
:
empty_
project
)
}
let
(
:message_raw
)
{
fixture_file
(
"emails/attachment.eml"
)
}
let
(
:message
)
{
Mail
::
Message
.
new
(
message_raw
)
}
...
...
spec/lib/gitlab/email/handler/create_issue_handler_spec.rb
View file @
9513bd18
...
...
@@ -69,7 +69,7 @@ describe Gitlab::Email::Handler::CreateIssueHandler do
end
context
"when project is private"
do
let
(
:project
)
{
create
(
:project
,
:private
,
namespace:
namespace
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
:private
,
namespace:
namespace
)
}
it
"raises a ProjectNotFound if the user is not a member"
do
expect
{
receiver
.
execute
}.
to
raise_error
(
Gitlab
::
Email
::
ProjectNotFound
)
...
...
spec/lib/gitlab/github_import/importer_spec.rb
View file @
9513bd18
...
...
@@ -207,7 +207,7 @@ describe Gitlab::GithubImport::Importer do
end
end
let
(
:project
)
{
create
(
:project
,
:wiki_disabled
,
import_url:
"
#{
repo_root
}
/octocat/Hello-World.git"
)
}
let
(
:project
)
{
create
(
:project
,
:
repository
,
:
wiki_disabled
,
import_url:
"
#{
repo_root
}
/octocat/Hello-World.git"
)
}
let
(
:octocat
)
{
double
(
id:
123456
,
login:
'octocat'
,
email:
'octocat@example.com'
)
}
let
(
:credentials
)
{
{
user:
'joe'
}
}
...
...
spec/lib/gitlab/github_import/wiki_formatter_spec.rb
View file @
9513bd18
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
Gitlab
::
GithubImport
::
WikiFormatter
do
let
(
:project
)
do
create
(
:project
,
create
(
:
empty_
project
,
namespace:
create
(
:namespace
,
path:
'gitlabhq'
),
import_url:
'https://xxx@github.com/gitlabhq/sample.gitlabhq.git'
)
end
...
...
spec/lib/gitlab/gl_repository_spec.rb
View file @
9513bd18
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
::
Gitlab
::
GlRepository
do
describe
'.parse'
do
set
(
:project
)
{
create
(
:project
)
}
set
(
:project
)
{
create
(
:project
,
:repository
)
}
it
'parses a project gl_repository'
do
expect
(
described_class
.
parse
(
"project-
#{
project
.
id
}
"
)).
to
eq
([
project
,
false
])
...
...
spec/lib/gitlab/import_export/fork_spec.rb
View file @
9513bd18
...
...
@@ -2,11 +2,11 @@ require 'spec_helper'
describe
'forked project import'
do
let
(
:user
)
{
create
(
:user
)
}
let!
(
:project_with_repo
)
{
create
(
:project
,
name:
'test-repo-restorer'
,
path:
'test-repo-restorer'
)
}
let!
(
:project_with_repo
)
{
create
(
:project
,
:repository
,
name:
'test-repo-restorer'
,
path:
'test-repo-restorer'
)
}
let!
(
:project
)
{
create
(
:empty_project
,
name:
'test-repo-restorer-no-repo'
,
path:
'test-repo-restorer-no-repo'
)
}
let
(
:export_path
)
{
"
#{
Dir
.
tmpdir
}
/project_tree_saver_spec"
}
let
(
:shared
)
{
Gitlab
::
ImportExport
::
Shared
.
new
(
relative_path:
project
.
full_path
)
}
let
(
:forked_from_project
)
{
create
(
:project
)
}
let
(
:forked_from_project
)
{
create
(
:project
,
:repository
)
}
let
(
:fork_link
)
{
create
(
:forked_project_link
,
forked_from_project:
project_with_repo
)
}
let
(
:repo_saver
)
{
Gitlab
::
ImportExport
::
RepoSaver
.
new
(
project:
project_with_repo
,
shared:
shared
)
}
let
(
:bundle_path
)
{
File
.
join
(
shared
.
export_path
,
Gitlab
::
ImportExport
.
project_bundle_filename
)
}
...
...
spec/lib/gitlab/import_export/merge_request_parser_spec.rb
View file @
9513bd18
...
...
@@ -2,8 +2,8 @@ require 'spec_helper'
describe
Gitlab
::
ImportExport
::
MergeRequestParser
do
let
(
:user
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
,
name:
'test-repo-restorer'
,
path:
'test-repo-restorer'
)
}
let
(
:forked_from_project
)
{
create
(
:project
)
}
let!
(
:project
)
{
create
(
:project
,
:repository
,
name:
'test-repo-restorer'
,
path:
'test-repo-restorer'
)
}
let
(
:forked_from_project
)
{
create
(
:project
,
:repository
)
}
let
(
:fork_link
)
{
create
(
:forked_project_link
,
forked_from_project:
project
)
}
let!
(
:merge_request
)
do
...
...
spec/lib/gitlab/import_export/repo_restorer_spec.rb
View file @
9513bd18
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
Gitlab
::
ImportExport
::
RepoRestorer
do
describe
'bundle a project Git repo'
do
let
(
:user
)
{
create
(
:user
)
}
let!
(
:project_with_repo
)
{
create
(
:project
,
name:
'test-repo-restorer'
,
path:
'test-repo-restorer'
)
}
let!
(
:project_with_repo
)
{
create
(
:project
,
:repository
,
name:
'test-repo-restorer'
,
path:
'test-repo-restorer'
)
}
let!
(
:project
)
{
create
(
:empty_project
)
}
let
(
:export_path
)
{
"
#{
Dir
.
tmpdir
}
/project_tree_saver_spec"
}
let
(
:shared
)
{
Gitlab
::
ImportExport
::
Shared
.
new
(
relative_path:
project
.
full_path
)
}
...
...
spec/lib/gitlab/issuable_sorter_spec.rb
View file @
9513bd18
require
'spec_helper'
describe
Gitlab
::
IssuableSorter
do
let
(
:namespace1
)
{
build
(
:namespace
,
id:
1
)
}
let
(
:project1
)
{
build
(
:
project
,
id:
1
,
namespace:
namespace1
)
}
let
(
:namespace1
)
{
build
_stubbed
(
:namespace
,
id:
1
)
}
let
(
:project1
)
{
build
_stubbed
(
:empty_
project
,
id:
1
,
namespace:
namespace1
)
}
let
(
:project2
)
{
build
(
:
project
,
id:
2
,
path:
"a"
,
namespace:
project1
.
namespace
)
}
let
(
:project3
)
{
build
(
:
project
,
id:
3
,
path:
"b"
,
namespace:
project1
.
namespace
)
}
let
(
:project2
)
{
build
_stubbed
(
:empty_
project
,
id:
2
,
path:
"a"
,
namespace:
project1
.
namespace
)
}
let
(
:project3
)
{
build
_stubbed
(
:empty_
project
,
id:
3
,
path:
"b"
,
namespace:
project1
.
namespace
)
}
let
(
:namespace2
)
{
build
(
:namespace
,
id:
2
,
path:
"a"
)
}
let
(
:namespace3
)
{
build
(
:namespace
,
id:
3
,
path:
"b"
)
}
let
(
:project4
)
{
build
(
:
project
,
id:
4
,
path:
"a"
,
namespace:
namespace2
)
}
let
(
:project5
)
{
build
(
:
project
,
id:
5
,
path:
"b"
,
namespace:
namespace2
)
}
let
(
:project6
)
{
build
(
:
project
,
id:
6
,
path:
"a"
,
namespace:
namespace3
)
}
let
(
:namespace2
)
{
build
_stubbed
(
:namespace
,
id:
2
,
path:
"a"
)
}
let
(
:namespace3
)
{
build
_stubbed
(
:namespace
,
id:
3
,
path:
"b"
)
}
let
(
:project4
)
{
build
_stubbed
(
:empty_
project
,
id:
4
,
path:
"a"
,
namespace:
namespace2
)
}
let
(
:project5
)
{
build
_stubbed
(
:empty_
project
,
id:
5
,
path:
"b"
,
namespace:
namespace2
)
}
let
(
:project6
)
{
build
_stubbed
(
:empty_
project
,
id:
6
,
path:
"a"
,
namespace:
namespace3
)
}
let
(
:unsorted
)
{
[
sorted
[
2
],
sorted
[
3
],
sorted
[
0
],
sorted
[
1
]]
}
let
(
:sorted
)
do
[
build
(
:issue
,
iid:
1
,
project:
project1
),
build
(
:issue
,
iid:
2
,
project:
project1
),
build
(
:issue
,
iid:
10
,
project:
project1
),
build
(
:issue
,
iid:
20
,
project:
project1
)]
[
build
_stubbed
(
:issue
,
iid:
1
,
project:
project1
),
build
_stubbed
(
:issue
,
iid:
2
,
project:
project1
),
build
_stubbed
(
:issue
,
iid:
10
,
project:
project1
),
build
_stubbed
(
:issue
,
iid:
20
,
project:
project1
)]
end
it
'sorts references by a given key'
do
...
...
@@ -41,14 +41,14 @@ describe Gitlab::IssuableSorter do
context
'for references from multiple projects and namespaces'
do
let
(
:sorted
)
do
[
build
(
:issue
,
iid:
1
,
project:
project1
),
build
(
:issue
,
iid:
2
,
project:
project1
),
build
(
:issue
,
iid:
10
,
project:
project1
),
build
(
:issue
,
iid:
1
,
project:
project2
),
build
(
:issue
,
iid:
1
,
project:
project3
),
build
(
:issue
,
iid:
1
,
project:
project4
),
build
(
:issue
,
iid:
1
,
project:
project5
),
build
(
:issue
,
iid:
1
,
project:
project6
)]
[
build
_stubbed
(
:issue
,
iid:
1
,
project:
project1
),
build
_stubbed
(
:issue
,
iid:
2
,
project:
project1
),
build
_stubbed
(
:issue
,
iid:
10
,
project:
project1
),
build
_stubbed
(
:issue
,
iid:
1
,
project:
project2
),
build
_stubbed
(
:issue
,
iid:
1
,
project:
project3
),
build
_stubbed
(
:issue
,
iid:
1
,
project:
project4
),
build
_stubbed
(
:issue
,
iid:
1
,
project:
project5
),
build
_stubbed
(
:issue
,
iid:
1
,
project:
project6
)]
end
let
(
:unsorted
)
do
[
sorted
[
3
],
sorted
[
1
],
sorted
[
4
],
sorted
[
2
],
...
...
spec/lib/gitlab/middleware/go_spec.rb
View file @
9513bd18
...
...
@@ -18,7 +18,7 @@ describe Gitlab::Middleware::Go do
let
(
:current_user
)
{
nil
}
context
'with simple 2-segment project path'
do
let!
(
:project
)
{
create
(
:project
,
:private
)
}
let!
(
:project
)
{
create
(
:
empty_
project
,
:private
)
}
context
'with subpackages'
do
let
(
:path
)
{
"
#{
project
.
full_path
}
/subpackage"
}
...
...
@@ -39,7 +39,7 @@ describe Gitlab::Middleware::Go do
context
'with a nested project path'
do
let
(
:group
)
{
create
(
:group
,
:nested
)
}
let!
(
:project
)
{
create
(
:project
,
:public
,
namespace:
group
)
}
let!
(
:project
)
{
create
(
:
empty_
project
,
:public
,
namespace:
group
)
}
shared_examples
'a nested project'
do
context
'when the project is public'
do
...
...
spec/lib/gitlab/project_search_results_spec.rb
View file @
9513bd18
...
...
@@ -100,14 +100,14 @@ describe Gitlab::ProjectSearchResults do
end
describe
'wiki search'
do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
:public
)
}
let
(
:wiki
)
{
build
(
:project_wiki
,
project:
project
)
}
let!
(
:wiki_page
)
{
wiki
.
create_page
(
'Title'
,
'Content'
)
}
subject
(
:results
)
{
described_class
.
new
(
user
,
project
,
'Content'
).
objects
(
'wiki_blobs'
)
}
context
'when wiki is disabled'
do
let
(
:project
)
{
create
(
:project
,
:public
,
:wiki_disabled
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
:public
,
:wiki_disabled
)
}
it
'hides wiki blobs from members'
do
project
.
add_reporter
(
user
)
...
...
@@ -121,7 +121,7 @@ describe Gitlab::ProjectSearchResults do
end
context
'when wiki is internal'
do
let
(
:project
)
{
create
(
:project
,
:public
,
:wiki_private
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
:public
,
:wiki_private
)
}
it
'finds wiki blobs for guest'
do
project
.
add_guest
(
user
)
...
...
spec/lib/gitlab/repo_path_spec.rb
View file @
9513bd18
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
::
Gitlab
::
RepoPath
do
describe
'.parse'
do
set
(
:project
)
{
create
(
:project
)
}
set
(
:project
)
{
create
(
:project
,
:repository
)
}
context
'a repository storage path'
do
it
'parses a full repository path'
do
...
...
spec/lib/gitlab/user_access_spec.rb
View file @
9513bd18
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
Gitlab
::
UserAccess
do
let
(
:access
)
{
described_class
.
new
(
user
,
project:
project
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
create
(
:user
)
}
describe
'#can_push_to_branch?'
do
...
...
spec/migrations/rename_system_namespaces_spec.rb
View file @
9513bd18
...
...
@@ -58,7 +58,7 @@ describe RenameSystemNamespaces, truncate: true do
end
it
"renames the route for projects of the namespace"
do
project
=
build
(
:project
,
path:
"project-path"
,
namespace:
system_namespace
)
project
=
build
(
:project
,
:repository
,
path:
"project-path"
,
namespace:
system_namespace
)
save_invalid_routable
(
project
)
migration
.
up
...
...
@@ -68,7 +68,7 @@ describe RenameSystemNamespaces, truncate: true do
it
"doesn't touch routes of namespaces that look like system"
do
namespace
=
create
(
:group
,
path:
'systemlookalike'
)
project
=
create
(
:project
,
namespace:
namespace
,
path:
'the-project'
)
project
=
create
(
:project
,
:repository
,
namespace:
namespace
,
path:
'the-project'
)
migration
.
up
...
...
@@ -77,7 +77,7 @@ describe RenameSystemNamespaces, truncate: true do
end
it
"moves the the repository for a project in the namespace"
do
project
=
build
(
:project
,
namespace:
system_namespace
,
path:
"system-project"
)
project
=
build
(
:project
,
:repository
,
namespace:
system_namespace
,
path:
"system-project"
)
save_invalid_routable
(
project
)
TestEnv
.
copy_repo
(
project
,
bare_repo:
TestEnv
.
factory_repo_path_bare
,
...
...
@@ -105,7 +105,7 @@ describe RenameSystemNamespaces, truncate: true do
describe
"clears the markdown cache for projects in the system namespace"
do
let!
(
:project
)
do
project
=
build
(
:project
,
namespace:
system_namespace
)
project
=
build
(
:project
,
:repository
,
namespace:
system_namespace
)
save_invalid_routable
(
project
)
project
end
...
...
@@ -161,7 +161,7 @@ describe RenameSystemNamespaces, truncate: true do
it
"updates the route of the project correctly"
do
subgroup
=
build
(
:group
,
path:
"subgroup"
,
parent:
system_namespace
)
save_invalid_routable
(
subgroup
)
project
=
build
(
:project
,
path:
"system0"
,
namespace:
subgroup
)
project
=
build
(
:project
,
:repository
,
path:
"system0"
,
namespace:
subgroup
)
save_invalid_routable
(
project
)
migration
.
up
...
...
@@ -174,7 +174,7 @@ describe RenameSystemNamespaces, truncate: true do
describe
"#move_repositories"
do
let
(
:namespace
)
{
create
(
:group
,
name:
"hello-group"
)
}
it
"moves a project for a namespace"
do
create
(
:project
,
namespace:
namespace
,
path:
"hello-project"
)
create
(
:project
,
:repository
,
namespace:
namespace
,
path:
"hello-project"
)
expected_path
=
File
.
join
(
TestEnv
.
repos_path
,
"bye-group"
,
"hello-project.git"
)
migration
.
move_repositories
(
namespace
,
"hello-group"
,
"bye-group"
)
...
...
@@ -184,7 +184,7 @@ describe RenameSystemNamespaces, truncate: true do
it
"moves a namespace in a subdirectory correctly"
do
child_namespace
=
create
(
:group
,
name:
"sub-group"
,
parent:
namespace
)
create
(
:project
,
namespace:
child_namespace
,
path:
"hello-project"
)
create
(
:project
,
:repository
,
namespace:
child_namespace
,
path:
"hello-project"
)
expected_path
=
File
.
join
(
TestEnv
.
repos_path
,
"hello-group"
,
"renamed-sub-group"
,
"hello-project.git"
)
...
...
@@ -195,7 +195,7 @@ describe RenameSystemNamespaces, truncate: true do
it
"moves a parent namespace with subdirectories"
do
child_namespace
=
create
(
:group
,
name:
"sub-group"
,
parent:
namespace
)
create
(
:project
,
namespace:
child_namespace
,
path:
"hello-project"
)
create
(
:project
,
:repository
,
namespace:
child_namespace
,
path:
"hello-project"
)
expected_path
=
File
.
join
(
TestEnv
.
repos_path
,
"renamed-group"
,
"sub-group"
,
"hello-project.git"
)
migration
.
move_repositories
(
child_namespace
,
"hello-group"
,
"renamed-group"
)
...
...
spec/models/blob_viewer/composer_json_spec.rb
View file @
9513bd18
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
BlobViewer
::
ComposerJson
do
include
FakeBlobHelpers
let
(
:project
)
{
build
(
:
project
)
}
let
(
:project
)
{
build
_stubbed
(
:empty_
project
)
}
let
(
:data
)
do
<<-
SPEC
.
strip_heredoc
{
...
...
spec/models/blob_viewer/gemspec_spec.rb
View file @
9513bd18
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
BlobViewer
::
Gemspec
do
include
FakeBlobHelpers
let
(
:project
)
{
build
(
:
project
)
}
let
(
:project
)
{
build
_stubbed
(
:empty_
project
)
}
let
(
:data
)
do
<<-
SPEC
.
strip_heredoc
Gem::Specification.new do |s|
...
...
spec/models/blob_viewer/gitlab_ci_yml_spec.rb
View file @
9513bd18
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
BlobViewer
::
GitlabCiYml
do
include
FakeBlobHelpers
let
(
:project
)
{
build
(
:
project
)
}
let
(
:project
)
{
build
_stubbed
(
:empty_
project
)
}
let
(
:data
)
{
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/gitlab_ci.yml'
))
}
let
(
:blob
)
{
fake_blob
(
path:
'.gitlab-ci.yml'
,
data:
data
)
}
subject
{
described_class
.
new
(
blob
)
}
...
...
spec/models/blob_viewer/package_json_spec.rb
View file @
9513bd18
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
BlobViewer
::
PackageJson
do
include
FakeBlobHelpers
let
(
:project
)
{
build
(
:
project
)
}
let
(
:project
)
{
build
_stubbed
(
:empty_
project
)
}
let
(
:data
)
do
<<-
SPEC
.
strip_heredoc
{
...
...
spec/models/blob_viewer/podspec_json_spec.rb
View file @
9513bd18
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
BlobViewer
::
PodspecJson
do
include
FakeBlobHelpers
let
(
:project
)
{
build
(
:
project
)
}
let
(
:project
)
{
build
_stubbed
(
:empty_
project
)
}
let
(
:data
)
do
<<-
SPEC
.
strip_heredoc
{
...
...
spec/models/blob_viewer/podspec_spec.rb
View file @
9513bd18
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
BlobViewer
::
Podspec
do
include
FakeBlobHelpers
let
(
:project
)
{
build
(
:
project
)
}
let
(
:project
)
{
build
_stubbed
(
:empty_
project
)
}
let
(
:data
)
do
<<-
SPEC
.
strip_heredoc
Pod::Spec.new do |spec|
...
...
spec/models/blob_viewer/route_map_spec.rb
View file @
9513bd18
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
BlobViewer
::
RouteMap
do
include
FakeBlobHelpers
let
(
:project
)
{
build
(
:
project
)
}
let
(
:project
)
{
build
_stubbed
(
:empty_
project
)
}
let
(
:data
)
do
<<-
MAP
.
strip_heredoc
# Team data
...
...
spec/models/concerns/participable_spec.rb
View file @
9513bd18
...
...
@@ -24,7 +24,7 @@ describe Participable do
user1
=
build
(
:user
)
user2
=
build
(
:user
)
user3
=
build
(
:user
)
project
=
build
(
:project
,
:public
)
project
=
build
(
:
empty_
project
,
:public
)
instance
=
model
.
new
expect
(
instance
).
to
receive
(
:foo
).
and_return
(
user2
)
...
...
@@ -57,7 +57,7 @@ describe Participable do
other
=
other_model
.
new
user1
=
build
(
:user
)
user2
=
build
(
:user
)
project
=
build
(
:project
,
:public
)
project
=
build
(
:
empty_
project
,
:public
)
expect
(
instance
).
to
receive
(
:foo
).
and_return
(
other
)
expect
(
other
).
to
receive
(
:bar
).
and_return
(
user2
)
...
...
@@ -69,7 +69,7 @@ describe Participable do
context
'when using a Proc as an attribute'
do
it
'calls the supplied Proc'
do
user1
=
build
(
:user
)
project
=
build
(
:project
,
:public
)
project
=
build
(
:
empty_
project
,
:public
)
user_arg
=
nil
ext_arg
=
nil
...
...
spec/models/concerns/resolvable_note_spec.rb
View file @
9513bd18
require
'spec_helper'
describe
Note
,
ResolvableNote
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
subject
{
create
(
:discussion_note_on_merge_request
,
noteable:
merge_request
,
project:
project
)
}
...
...
spec/models/concerns/routable_spec.rb
View file @
9513bd18
...
...
@@ -27,7 +27,7 @@ describe Group, 'Routable' do
it
'ensure route path uniqueness across different objects'
do
create
(
:group
,
parent:
group
,
path:
'xyz'
)
duplicate
=
build
(
:project
,
namespace:
group
,
path:
'xyz'
)
duplicate
=
build
(
:
empty_
project
,
namespace:
group
,
path:
'xyz'
)
expect
{
duplicate
.
save!
}.
to
raise_error
(
ActiveRecord
::
RecordInvalid
,
'Validation failed: Route path has already been taken, Route is invalid'
)
end
...
...
spec/models/container_repository_spec.rb
View file @
9513bd18
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
ContainerRepository
do
let
(
:group
)
{
create
(
:group
,
name:
'group'
)
}
let
(
:project
)
{
create
(
:project
,
path:
'test'
,
group:
group
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
path:
'test'
,
group:
group
)
}
let
(
:repository
)
do
create
(
:container_repository
,
name:
'my_image'
,
project:
project
)
...
...
@@ -41,7 +41,7 @@ describe ContainerRepository do
end
context
'when path contains uppercase letters'
do
let
(
:project
)
{
create
(
:project
,
path:
'MY_PROJECT'
,
group:
group
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
path:
'MY_PROJECT'
,
group:
group
)
}
it
'returns a full path without capital letters'
do
expect
(
repository
.
path
).
to
eq
(
'group/my_project/my_image'
)
...
...
spec/models/deployment_spec.rb
View file @
9513bd18
...
...
@@ -91,7 +91,7 @@ describe Deployment do
end
describe
'#additional_metrics'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:deployment
)
{
create
(
:deployment
,
project:
project
)
}
subject
{
deployment
.
additional_metrics
}
...
...
spec/models/diff_discussion_spec.rb
View file @
9513bd18
...
...
@@ -5,7 +5,7 @@ describe DiffDiscussion do
subject
{
described_class
.
new
([
diff_note
])
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
target_project:
project
)
}
let
(
:diff_note
)
{
create
(
:diff_note_on_merge_request
,
noteable:
merge_request
,
project:
project
)
}
...
...
spec/models/environment_spec.rb
View file @
9513bd18
...
...
@@ -21,7 +21,7 @@ describe Environment do
it
{
is_expected
.
to
validate_uniqueness_of
(
:external_url
).
scoped_to
(
:project_id
)
}
describe
'.order_by_last_deployed_at'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let!
(
:environment1
)
{
create
(
:environment
,
project:
project
)
}
let!
(
:environment2
)
{
create
(
:environment
,
project:
project
)
}
let!
(
:environment3
)
{
create
(
:environment
,
project:
project
)
}
...
...
spec/models/forked_project_link_spec.rb
View file @
9513bd18
...
...
@@ -41,7 +41,7 @@ describe ForkedProjectLink, "add link on fork" do
end
describe
'#forked?'
do
let
(
:project_to
)
{
create
(
:project
,
forked_project_link:
forked_project_link
)
}
let
(
:project_to
)
{
create
(
:project
,
:repository
,
forked_project_link:
forked_project_link
)
}
let
(
:forked_project_link
)
{
create
(
:forked_project_link
)
}
before
do
...
...
spec/models/gpg_signature_spec.rb
View file @
9513bd18
...
...
@@ -16,7 +16,7 @@ RSpec.describe GpgSignature do
describe
'#commit'
do
it
'fetches the commit through the project'
do
commit_sha
=
'0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'
project
=
create
:project
project
=
create
:project
,
:repository
commit
=
create
:commit
,
project:
project
gpg_signature
=
create
:gpg_signature
,
commit_sha:
commit_sha
...
...
spec/models/issue_spec.rb
View file @
9513bd18
...
...
@@ -724,7 +724,7 @@ describe Issue do
end
describe
'#check_for_spam'
do
let
(
:project
)
{
create
:project
,
visibility_level:
visibility_level
}
let
(
:project
)
{
create
:
empty_
project
,
visibility_level:
visibility_level
}
let
(
:issue
)
{
create
:issue
,
project:
project
}
subject
do
...
...
spec/models/project_group_link_spec.rb
View file @
9513bd18
...
...
@@ -9,7 +9,7 @@ describe ProjectGroupLink do
describe
"Validation"
do
let
(
:parent_group
)
{
create
(
:group
)
}
let
(
:group
)
{
create
(
:group
,
parent:
parent_group
)
}
let
(
:project
)
{
create
(
:project
,
group:
group
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
group:
group
)
}
let!
(
:project_group_link
)
{
create
(
:project_group_link
,
project:
project
)
}
it
{
is_expected
.
to
validate_presence_of
(
:project_id
)
}
...
...
spec/models/project_services/chat_notification_service_spec.rb
View file @
9513bd18
...
...
@@ -20,7 +20,7 @@ describe ChatNotificationService do
context
'with repository'
do
it
'returns true'
do
subject
.
project
=
create
(
:project
)
subject
.
project
=
create
(
:project
,
:repository
)
expect
(
subject
.
can_test?
).
to
be
true
end
...
...
spec/models/project_services/issue_tracker_service_spec.rb
View file @
9513bd18
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
IssueTrackerService
do
describe
'Validations'
do
let
(
:project
)
{
create
:project
}
let
(
:project
)
{
create
:
empty_
project
}
describe
'only one issue tracker per project'
do
let
(
:service
)
{
RedmineService
.
new
(
project:
project
,
active:
true
)
}
...
...
spec/models/project_services/jira_service_spec.rb
View file @
9513bd18
...
...
@@ -190,7 +190,7 @@ describe JiraService do
describe
'#test_settings'
do
let
(
:jira_service
)
do
described_class
.
new
(
project:
create
(
:project
),
project:
create
(
:
empty_
project
),
url:
'http://jira.example.com'
,
username:
'jira_username'
,
password:
'jira_password'
...
...
spec/models/project_spec.rb
View file @
9513bd18
...
...
@@ -261,27 +261,27 @@ describe Project do
describe
'path validation'
do
it
'allows paths reserved on the root namespace'
do
project
=
build
(
:project
,
path:
'api'
)
project
=
build
(
:
empty_
project
,
path:
'api'
)
expect
(
project
).
to
be_valid
end
it
'rejects paths reserved on another level'
do
project
=
build
(
:project
,
path:
'tree'
)
project
=
build
(
:
empty_
project
,
path:
'tree'
)
expect
(
project
).
not_to
be_valid
end
it
'rejects nested paths'
do
parent
=
create
(
:group
,
:nested
,
path:
'environments'
)
project
=
build
(
:project
,
path:
'folders'
,
namespace:
parent
)
project
=
build
(
:
empty_
project
,
path:
'folders'
,
namespace:
parent
)
expect
(
project
).
not_to
be_valid
end
it
'allows a reserved group name'
do
parent
=
create
(
:group
)
project
=
build
(
:project
,
path:
'avatar'
,
namespace:
parent
)
project
=
build
(
:
empty_
project
,
path:
'avatar'
,
namespace:
parent
)
expect
(
project
).
to
be_valid
end
...
...
@@ -2045,7 +2045,7 @@ describe Project do
end
describe
'#route_map_for'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:route_map
)
do
<<-
MAP
.
strip_heredoc
- source: /source/(.*)/
...
...
@@ -2082,7 +2082,7 @@ describe Project do
end
describe
'#public_path_for_source_path'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:route_map
)
do
Gitlab
::
RouteMap
.
new
(
<<-
MAP
.
strip_heredoc
)
- source: /source/(.*)/
...
...
@@ -2196,7 +2196,7 @@ describe Project do
end
describe
'#pipeline_status'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
it
'builds a pipeline status'
do
expect
(
project
.
pipeline_status
).
to
be_a
(
Gitlab
::
Cache
::
Ci
::
ProjectPipelineStatus
)
end
...
...
@@ -2207,7 +2207,7 @@ describe Project do
end
describe
'#append_or_update_attribute'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
it
'shows full error updating an invalid MR'
do
error_message
=
'Failed to replace merge_requests because one or more of the new records could not be saved.'
\
...
...
spec/models/project_team_spec.rb
View file @
9513bd18
...
...
@@ -330,7 +330,7 @@ describe ProjectTeam do
end
shared_examples
'max member access for users'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:second_group
)
{
create
(
:group
)
}
...
...
spec/models/repository_spec.rb
View file @
9513bd18
...
...
@@ -300,7 +300,7 @@ describe Repository do
end
context
"when committing to another project"
do
let
(
:forked_project
)
{
create
(
:project
)
}
let
(
:forked_project
)
{
create
(
:project
,
:repository
)
}
it
"creates a fork and commit to the forked project"
do
expect
do
...
...
spec/models/sent_notification_spec.rb
View file @
9513bd18
...
...
@@ -21,7 +21,7 @@ describe SentNotification do
end
context
"when the noteable project and discussion project match"
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:discussion_id
)
{
create
(
:note
,
project:
project
,
noteable:
issue
).
discussion_id
}
subject
{
build
(
:sent_notification
,
project:
project
,
noteable:
issue
,
in_reply_to_discussion_id:
discussion_id
)
}
...
...
@@ -128,7 +128,7 @@ describe SentNotification do
end
context
'for commit'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:commit
)
{
project
.
commit
}
subject
{
described_class
.
record
(
commit
,
project
.
creator
.
id
)
}
...
...
spec/policies/ci/build_policy_spec.rb
View file @
9513bd18
...
...
@@ -97,7 +97,7 @@ describe Ci::BuildPolicy do
end
describe
'rules for protected ref'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:build
)
{
create
(
:ci_build
,
ref:
'some-ref'
,
pipeline:
pipeline
)
}
before
do
...
...
spec/policies/ci/pipeline_policy_spec.rb
View file @
9513bd18
...
...
@@ -10,7 +10,7 @@ describe Ci::PipelinePolicy, :models do
describe
'rules'
do
describe
'rules for protected ref'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
before
do
project
.
add_developer
(
user
)
...
...
spec/policies/environment_policy_spec.rb
View file @
9513bd18
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
EnvironmentPolicy
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:environment
)
do
create
(
:environment
,
:with_review_app
,
project:
project
)
...
...
@@ -14,7 +14,7 @@ describe EnvironmentPolicy do
describe
'#rules'
do
context
'when user does not have access to the project'
do
let
(
:project
)
{
create
(
:project
,
:private
)
}
let
(
:project
)
{
create
(
:project
,
:private
,
:repository
)
}
it
'does not include ability to stop environment'
do
expect
(
policy
).
to
be_disallowed
:stop_environment
...
...
@@ -22,7 +22,7 @@ describe EnvironmentPolicy do
end
context
'when anonymous user has access to the project'
do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
it
'does not include ability to stop environment'
do
expect
(
policy
).
to
be_disallowed
:stop_environment
...
...
@@ -30,7 +30,7 @@ describe EnvironmentPolicy do
end
context
'when team member has access to the project'
do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
before
do
project
.
add_developer
(
user
)
...
...
spec/presenters/merge_request_presenter_spec.rb
View file @
9513bd18
...
...
@@ -105,7 +105,7 @@ describe MergeRequestPresenter do
end
context
'issues links'
do
let
(
:project
)
{
create
(
:project
,
:private
,
creator:
user
,
namespace:
user
.
namespace
)
}
let
(
:project
)
{
create
(
:project
,
:private
,
:repository
,
creator:
user
,
namespace:
user
.
namespace
)
}
let
(
:issue_a
)
{
create
(
:issue
,
project:
project
)
}
let
(
:issue_b
)
{
create
(
:issue
,
project:
project
)
}
...
...
spec/requests/api/files_spec.rb
View file @
9513bd18
...
...
@@ -80,7 +80,7 @@ describe API::Files do
context
'when unauthenticated'
,
'and project is public'
do
it_behaves_like
'repository files'
do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:current_user
)
{
nil
}
end
end
...
...
@@ -153,7 +153,7 @@ describe API::Files do
context
'when unauthenticated'
,
'and project is public'
do
it_behaves_like
'repository raw files'
do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:current_user
)
{
nil
}
end
end
...
...
spec/requests/api/pipeline_schedules_spec.rb
View file @
9513bd18
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
API
::
PipelineSchedules
do
set
(
:developer
)
{
create
(
:user
)
}
set
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
(
:project
)
}
set
(
:project
)
{
create
(
:project
,
:repository
)
}
before
do
project
.
add_developer
(
developer
)
...
...
spec/requests/api/todos_spec.rb
View file @
9513bd18
require
'spec_helper'
describe
API
::
Todos
do
let
(
:project_1
)
{
create
(
:project
)
}
let
(
:project_1
)
{
create
(
:project
,
:repository
)
}
let
(
:project_2
)
{
create
(
:empty_project
)
}
let
(
:author_1
)
{
create
(
:user
)
}
let
(
:author_2
)
{
create
(
:user
)
}
...
...
spec/requests/api/triggers_spec.rb
View file @
9513bd18
...
...
@@ -13,7 +13,7 @@ describe API::Triggers do
let!
(
:trigger_request
)
{
create
(
:ci_trigger_request
,
trigger:
trigger
,
created_at:
'2015-01-01 12:13:14'
)
}
describe
'POST /projects/:project_id/trigger/pipeline'
do
let!
(
:project2
)
{
create
(
:project
)
}
let!
(
:project2
)
{
create
(
:project
,
:repository
)
}
let
(
:options
)
do
{
token:
trigger_token
...
...
spec/requests/api/v3/files_spec.rb
View file @
9513bd18
...
...
@@ -74,7 +74,7 @@ describe API::V3::Files do
context
'when unauthenticated'
,
'and project is public'
do
it_behaves_like
'repository files'
do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:current_user
)
{
nil
}
end
end
...
...
spec/requests/api/v3/project_hooks_spec.rb
View file @
9513bd18
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
API
::
ProjectHooks
,
'ProjectHooks'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user3
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let!
(
:project
)
{
create
(
:
empty_
project
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let!
(
:hook
)
do
create
(
:project_hook
,
:all_events_enabled
,
...
...
@@ -204,7 +204,7 @@ describe API::ProjectHooks, 'ProjectHooks' do
it
"returns a 404 if a user attempts to delete project hooks he/she does not own"
do
test_user
=
create
(
:user
)
other_project
=
create
(
:project
)
other_project
=
create
(
:
empty_
project
)
other_project
.
team
<<
[
test_user
,
:master
]
delete
v3_api
(
"/projects/
#{
other_project
.
id
}
/hooks/
#{
hook
.
id
}
"
,
test_user
)
...
...
spec/requests/api/v3/triggers_spec.rb
View file @
9513bd18
...
...
@@ -10,7 +10,7 @@ describe API::V3::Triggers do
let!
(
:trigger
)
{
create
(
:ci_trigger
,
project:
project
,
token:
trigger_token
)
}
describe
'POST /projects/:project_id/trigger'
do
let!
(
:project2
)
{
create
(
:project
)
}
let!
(
:project2
)
{
create
(
:
empty_
project
)
}
let
(
:options
)
do
{
token:
trigger_token
...
...
spec/requests/lfs_http_spec.rb
View file @
9513bd18
...
...
@@ -600,7 +600,7 @@ describe 'Git LFS API and storage' do
context
'when user is not authenticated'
do
describe
'is accessing public project'
do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
:public
)
}
let
(
:update_lfs_permissions
)
do
project
.
lfs_objects
<<
lfs_object
...
...
@@ -642,7 +642,7 @@ describe 'Git LFS API and storage' do
end
describe
'upload'
do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
:public
)
}
let
(
:body
)
do
{
'operation'
=>
'upload'
,
...
...
@@ -1019,7 +1019,7 @@ describe 'Git LFS API and storage' do
end
describe
'to a forked project'
do
let
(
:upstream_project
)
{
create
(
:project
,
:public
)
}
let
(
:upstream_project
)
{
create
(
:
empty_
project
,
:public
)
}
let
(
:project_owner
)
{
create
(
:user
)
}
let
(
:project
)
{
fork_project
(
upstream_project
,
project_owner
)
}
...
...
spec/requests/request_profiler_spec.rb
View file @
9513bd18
...
...
@@ -13,7 +13,7 @@ describe 'Request Profiler' do
end
it
'creates a profile of the request'
do
project
=
create
(
:project
,
namespace:
user
.
namespace
)
project
=
create
(
:
empty_
project
,
namespace:
user
.
namespace
)
time
=
Time
.
now
path
=
"/
#{
project
.
full_path
}
"
...
...
spec/services/ci/create_pipeline_service_spec.rb
View file @
9513bd18
...
...
@@ -75,7 +75,7 @@ describe Ci::CreatePipelineService do
end
context
'when merge request target project is different from source project'
do
let!
(
:target_project
)
{
create
(
:project
)
}
let!
(
:target_project
)
{
create
(
:project
,
:repository
)
}
let!
(
:forked_project_link
)
{
create
(
:forked_project_link
,
forked_to_project:
project
,
forked_from_project:
target_project
)
}
it
'updates head pipeline for merge request'
do
...
...
spec/services/ci/play_build_service_spec.rb
View file @
9513bd18
...
...
@@ -33,7 +33,7 @@ describe Ci::PlayBuildService, '#execute' do
end
context
'when project has repository'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
it
'allows user with developer role to play a build'
do
project
.
add_developer
(
user
)
...
...
spec/services/labels/create_service_spec.rb
View file @
9513bd18
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
Labels
::
CreateService
do
describe
'#execute'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:hex_color
)
{
'#FF0000'
}
...
...
spec/services/labels/update_service_spec.rb
View file @
9513bd18
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
Labels
::
UpdateService
do
describe
'#execute'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:hex_color
)
{
'#FF0000'
}
let
(
:named_color
)
{
'red'
}
...
...
spec/services/milestones/destroy_service_spec.rb
View file @
9513bd18
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
Milestones
::
DestroyService
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:milestone
)
{
create
(
:milestone
,
title:
'Milestone v1.0'
,
project:
project
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
,
milestone:
milestone
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
milestone:
milestone
)
}
...
...
spec/services/users/destroy_service_spec.rb
View file @
9513bd18
...
...
@@ -40,7 +40,7 @@ describe Users::DestroyService do
end
context
"a deleted user's issues"
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
before
do
project
.
add_developer
(
user
)
...
...
@@ -66,7 +66,7 @@ describe Users::DestroyService do
end
context
"a deleted user's merge_requests"
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
before
do
project
.
add_developer
(
user
)
...
...
spec/services/users/migrate_to_ghost_user_service_spec.rb
View file @
9513bd18
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
Users
::
MigrateToGhostUserService
do
let!
(
:user
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:service
)
{
described_class
.
new
(
user
)
}
context
"migrating a user's associated records to the ghost user"
do
...
...
spec/support/features/issuable_slash_commands_shared_examples.rb
View file @
9513bd18
...
...
@@ -5,7 +5,14 @@ shared_examples 'issuable record that supports quick actions in its description
include
QuickActionsHelpers
let
(
:master
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
do
case
issuable_type
when
:merge_request
create
(
:project
,
:public
,
:repository
)
when
:issue
create
(
:empty_project
,
:public
)
end
end
let!
(
:milestone
)
{
create
(
:milestone
,
project:
project
,
title:
'ASAP'
)
}
let!
(
:label_bug
)
{
create
(
:label
,
project:
project
,
title:
'bug'
)
}
let!
(
:label_feature
)
{
create
(
:label
,
project:
project
,
title:
'feature'
)
}
...
...
spec/support/import_export/export_file_helper.rb
View file @
9513bd18
...
...
@@ -6,7 +6,7 @@ module ExportFileHelper
ObjectWithParent
=
Struct
.
new
(
:object
,
:parent
,
:key_found
)
def
setup_project
project
=
create
(
:project
,
:public
)
project
=
create
(
:project
,
:public
,
:repository
)
create
(
:release
,
project:
project
)
...
...
spec/support/services/migrate_to_ghost_user_service_shared_examples.rb
View file @
9513bd18
...
...
@@ -3,7 +3,14 @@ require "spec_helper"
shared_examples
"migrating a deleted user's associated records to the ghost user"
do
|
record_class
,
fields
|
record_class_name
=
record_class
.
to_s
.
titleize
.
downcase
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
do
case
record_class
when
MergeRequest
create
(
:project
,
:repository
)
else
create
(
:empty_project
)
end
end
before
do
project
.
add_developer
(
user
)
...
...
spec/uploaders/file_uploader_spec.rb
View file @
9513bd18
...
...
@@ -5,7 +5,7 @@ describe FileUploader do
describe
'.absolute_path'
do
it
'returns the correct absolute path by building it dynamically'
do
project
=
build_stubbed
(
:project
)
project
=
build_stubbed
(
:
empty_
project
)
upload
=
double
(
model:
project
,
path:
'secret/foo.jpg'
)
dynamic_segment
=
project
.
path_with_namespace
...
...
spec/validators/dynamic_path_validator_spec.rb
View file @
9513bd18
...
...
@@ -28,7 +28,7 @@ describe DynamicPathValidator do
describe
'#path_valid_for_record?'
do
context
'for project'
do
it
'calls valid_project_path?'
do
project
=
build
(
:project
,
path:
'activity'
)
project
=
build
(
:
empty_
project
,
path:
'activity'
)
expect
(
described_class
).
to
receive
(
:valid_project_path?
).
with
(
project
.
full_path
).
and_call_original
...
...
spec/views/layouts/nav/_project.html.haml_spec.rb
View file @
9513bd18
...
...
@@ -5,7 +5,7 @@ describe 'layouts/nav/_project' do
before
do
stub_container_registry_config
(
enabled:
true
)
assign
(
:project
,
create
(
:project
))
assign
(
:project
,
create
(
:project
,
:repository
))
allow
(
view
).
to
receive
(
:current_ref
).
and_return
(
'master'
)
allow
(
view
).
to
receive
(
:can?
).
and_return
(
true
)
...
...
spec/views/notify/pipeline_failed_email.html.haml_spec.rb
View file @
9513bd18
...
...
@@ -4,7 +4,7 @@ describe 'notify/pipeline_failed_email.html.haml' do
include
Devise
::
Test
::
ControllerHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
:simple
,
source_project:
project
)
}
let
(
:pipeline
)
do
...
...
spec/views/notify/pipeline_success_email.html.haml_spec.rb
View file @
9513bd18
...
...
@@ -4,7 +4,7 @@ describe 'notify/pipeline_success_email.html.haml' do
include
Devise
::
Test
::
ControllerHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
:simple
,
source_project:
project
)
}
let
(
:pipeline
)
do
...
...
spec/workers/create_gpg_signature_worker_spec.rb
View file @
9513bd18
...
...
@@ -4,7 +4,7 @@ describe CreateGpgSignatureWorker do
context
'when GpgKey is found'
do
it
'calls Commit#signature'
do
commit_sha
=
'0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'
project
=
create
:project
project
=
create
:
empty_
project
commit
=
instance_double
(
Commit
)
allow
(
Project
).
to
receive
(
:find_by
).
with
(
id:
project
.
id
).
and_return
(
project
)
...
...
@@ -18,7 +18,7 @@ describe CreateGpgSignatureWorker do
context
'when Commit is not found'
do
let
(
:nonexisting_commit_sha
)
{
'bogus'
}
let
(
:project
)
{
create
:project
}
let
(
:project
)
{
create
:
empty_
project
}
it
'does not raise errors'
do
expect
{
described_class
.
new
.
perform
(
nonexisting_commit_sha
,
project
.
id
)
}.
not_to
raise_error
...
...
spec/workers/process_commit_worker_spec.rb
View file @
9513bd18
...
...
@@ -33,7 +33,7 @@ describe ProcessCommitWorker do
end
context
'when commit already exists in upstream project'
do
let
(
:forked
)
{
create
(
:project
,
:public
)
}
let
(
:forked
)
{
create
(
:project
,
:public
,
:repository
)
}
it
'does not process commit message'
do
create
(
:forked_project_link
,
forked_to_project:
forked
,
forked_from_project:
project
)
...
...
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