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
Tatuya Kamada
gitlab-ce
Commits
3deb66ea
Commit
3deb66ea
authored
Feb 02, 2017
by
Semyon Pupkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add traits for ProjectFeatures to Project factory
https://gitlab.com/gitlab-org/gitlab-ce/issues/24007
parent
4d11903d
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
62 additions
and
78 deletions
+62
-78
spec/controllers/search_controller_spec.rb
spec/controllers/search_controller_spec.rb
+3
-13
spec/factories/projects.rb
spec/factories/projects.rb
+19
-0
spec/features/groups/merge_requests_spec.rb
spec/features/groups/merge_requests_spec.rb
+1
-1
spec/features/projects/settings/merge_requests_settings_spec.rb
...eatures/projects/settings/merge_requests_settings_spec.rb
+0
-5
spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb
...res/projects/wiki/user_views_wiki_in_project_page_spec.rb
+5
-7
spec/finders/issues_finder_spec.rb
spec/finders/issues_finder_spec.rb
+1
-1
spec/finders/notes_finder_spec.rb
spec/finders/notes_finder_spec.rb
+5
-5
spec/helpers/projects_helper_spec.rb
spec/helpers/projects_helper_spec.rb
+0
-1
spec/lib/gitlab/contributions_calendar_spec.rb
spec/lib/gitlab/contributions_calendar_spec.rb
+1
-1
spec/lib/gitlab/git_access_spec.rb
spec/lib/gitlab/git_access_spec.rb
+0
-2
spec/lib/gitlab/git_access_wiki_spec.rb
spec/lib/gitlab/git_access_wiki_spec.rb
+0
-2
spec/lib/gitlab/github_import/importer_spec.rb
spec/lib/gitlab/github_import/importer_spec.rb
+1
-1
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
+7
-7
spec/lib/gitlab/import_export/project_tree_saver_spec.rb
spec/lib/gitlab/import_export/project_tree_saver_spec.rb
+3
-4
spec/lib/gitlab/project_search_results_spec.rb
spec/lib/gitlab/project_search_results_spec.rb
+2
-2
spec/models/ability_spec.rb
spec/models/ability_spec.rb
+1
-1
spec/models/guest_spec.rb
spec/models/guest_spec.rb
+0
-2
spec/models/project_feature_spec.rb
spec/models/project_feature_spec.rb
+0
-2
spec/models/project_spec.rb
spec/models/project_spec.rb
+1
-1
spec/models/user_spec.rb
spec/models/user_spec.rb
+1
-1
spec/requests/api/issues_spec.rb
spec/requests/api/issues_spec.rb
+1
-1
spec/requests/git_http_spec.rb
spec/requests/git_http_spec.rb
+4
-8
spec/services/projects/create_service_spec.rb
spec/services/projects/create_service_spec.rb
+0
-4
spec/support/services/issuable_create_service_shared_examples.rb
...pport/services/issuable_create_service_shared_examples.rb
+2
-2
spec/workers/repository_check/single_repository_worker_spec.rb
...workers/repository_check/single_repository_worker_spec.rb
+4
-4
No files found.
spec/controllers/search_controller_spec.rb
View file @
3deb66ea
...
...
@@ -2,7 +2,6 @@ require 'spec_helper'
describe
SearchController
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:empty_project
,
:public
)
}
before
do
sign_in
(
user
)
...
...
@@ -22,7 +21,7 @@ describe SearchController do
before
{
sign_out
(
user
)
}
it
"doesn't expose comments on issues"
do
project
=
create
(
:empty_project
,
:public
,
issues_access_level:
ProjectFeature
::
PRIVATE
)
project
=
create
(
:empty_project
,
:public
,
:issues_private
)
note
=
create
(
:note_on_issue
,
project:
project
)
get
:show
,
project_id:
project
.
id
,
scope:
'notes'
,
search:
note
.
note
...
...
@@ -31,17 +30,8 @@ describe SearchController do
end
end
it
"doesn't expose comments on issues"
do
project
=
create
(
:empty_project
,
:public
,
issues_access_level:
ProjectFeature
::
PRIVATE
)
note
=
create
(
:note_on_issue
,
project:
project
)
get
:show
,
project_id:
project
.
id
,
scope:
'notes'
,
search:
note
.
note
expect
(
assigns
[
:search_objects
].
count
).
to
eq
(
0
)
end
it
"doesn't expose comments on merge_requests"
do
project
=
create
(
:empty_project
,
:public
,
merge_requests_access_level:
ProjectFeature
::
PRIVATE
)
project
=
create
(
:empty_project
,
:public
,
:merge_requests_private
)
note
=
create
(
:note_on_merge_request
,
project:
project
)
get
:show
,
project_id:
project
.
id
,
scope:
'notes'
,
search:
note
.
note
...
...
@@ -50,7 +40,7 @@ describe SearchController do
end
it
"doesn't expose comments on snippets"
do
project
=
create
(
:empty_project
,
:public
,
snippets_access_level:
ProjectFeature
::
PRIVATE
)
project
=
create
(
:empty_project
,
:public
,
:snippets_private
)
note
=
create
(
:note_on_project_snippet
,
project:
project
)
get
:show
,
project_id:
project
.
id
,
scope:
'notes'
,
search:
note
.
note
...
...
spec/factories/projects.rb
View file @
3deb66ea
...
...
@@ -56,6 +56,25 @@ FactoryGirl.define do
end
end
trait
(
:wiki_enabled
)
{
wiki_access_level
ProjectFeature
::
ENABLED
}
trait
(
:wiki_disabled
)
{
wiki_access_level
ProjectFeature
::
DISABLED
}
trait
(
:wiki_private
)
{
wiki_access_level
ProjectFeature
::
PRIVATE
}
trait
(
:builds_enabled
)
{
builds_access_level
ProjectFeature
::
ENABLED
}
trait
(
:builds_disabled
)
{
builds_access_level
ProjectFeature
::
DISABLED
}
trait
(
:builds_private
)
{
builds_access_level
ProjectFeature
::
PRIVATE
}
trait
(
:snippets_enabled
)
{
snippets_access_level
ProjectFeature
::
ENABLED
}
trait
(
:snippets_disabled
)
{
snippets_access_level
ProjectFeature
::
DISABLED
}
trait
(
:snippets_private
)
{
snippets_access_level
ProjectFeature
::
PRIVATE
}
trait
(
:issues_disabled
)
{
issues_access_level
ProjectFeature
::
DISABLED
}
trait
(
:issues_enabled
)
{
issues_access_level
ProjectFeature
::
ENABLED
}
trait
(
:issues_private
)
{
issues_access_level
ProjectFeature
::
PRIVATE
}
trait
(
:merge_requests_enabled
)
{
merge_requests_access_level
ProjectFeature
::
ENABLED
}
trait
(
:merge_requests_disabled
)
{
merge_requests_access_level
ProjectFeature
::
DISABLED
}
trait
(
:merge_requests_private
)
{
merge_requests_access_level
ProjectFeature
::
PRIVATE
}
trait
(
:repository_enabled
)
{
repository_access_level
ProjectFeature
::
ENABLED
}
trait
(
:repository_disabled
)
{
repository_access_level
ProjectFeature
::
DISABLED
}
trait
(
:repository_private
)
{
repository_access_level
ProjectFeature
::
PRIVATE
}
# Nest Project Feature attributes
transient
do
wiki_access_level
ProjectFeature
::
ENABLED
...
...
spec/features/groups/merge_requests_spec.rb
View file @
3deb66ea
...
...
@@ -7,7 +7,7 @@ feature 'Group merge requests page', feature: true do
include_examples
'project features apply to issuables'
,
MergeRequest
context
'archived issuable'
do
let
(
:project_archived
)
{
create
(
:project
,
:archived
,
group:
group
,
merge_requests_access_level:
ProjectFeature
::
ENABLED
)
}
let
(
:project_archived
)
{
create
(
:project
,
:archived
,
:merge_requests_enabled
,
group:
group
)
}
let
(
:issuable_archived
)
{
create
(
:merge_request
,
source_project:
project_archived
,
target_project:
project_archived
,
title:
'issuable of an archived project'
)
}
let
(
:access_level
)
{
ProjectFeature
::
ENABLED
}
let
(
:user
)
{
user_in_group
}
...
...
spec/features/projects/settings/merge_requests_settings_spec.rb
View file @
3deb66ea
...
...
@@ -12,13 +12,8 @@ feature 'Project settings > Merge Requests', feature: true, js: true do
end
context
'when Merge Request and Pipelines are initially enabled'
do
before
do
project
.
project_feature
.
update_attribute
(
'merge_requests_access_level'
,
ProjectFeature
::
ENABLED
)
end
context
'when Pipelines are initially enabled'
do
before
do
project
.
project_feature
.
update_attribute
(
'builds_access_level'
,
ProjectFeature
::
ENABLED
)
visit
edit_project_path
(
project
)
end
...
...
spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb
View file @
3deb66ea
...
...
@@ -2,7 +2,6 @@ require 'spec_helper'
describe
'Projects > Wiki > User views wiki in project page'
,
feature:
true
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:empty_project
)
}
before
do
project
.
team
<<
[
user
,
:master
]
...
...
@@ -10,12 +9,11 @@ describe 'Projects > Wiki > User views wiki in project page', feature: true do
end
context
'when repository is disabled for project'
do
before
do
project
.
project_feature
.
update!
(
repository_access_level:
ProjectFeature
::
DISABLED
,
merge_requests_access_level:
ProjectFeature
::
DISABLED
,
builds_access_level:
ProjectFeature
::
DISABLED
)
let
(
:project
)
do
create
(
:empty_project
,
:repository_disabled
,
:merge_requests_disabled
,
:builds_disabled
)
end
context
'when wiki homepage contains a link'
do
...
...
spec/finders/issues_finder_spec.rb
View file @
3deb66ea
...
...
@@ -224,7 +224,7 @@ describe IssuesFinder do
let
(
:scope
)
{
nil
}
it
"doesn't return team-only issues to non team members"
do
project
=
create
(
:empty_project
,
:public
,
issues_access_level:
ProjectFeature
::
PRIVATE
)
project
=
create
(
:empty_project
,
:public
,
:issues_private
)
issue
=
create
(
:issue
,
project:
project
)
expect
(
issues
).
not_to
include
(
issue
)
...
...
spec/finders/notes_finder_spec.rb
View file @
3deb66ea
...
...
@@ -9,8 +9,6 @@ describe NotesFinder do
end
describe
'#execute'
do
it
'finds notes on snippets when project is public and user isnt a member'
it
'finds notes on merge requests'
do
create
(
:note_on_merge_request
,
project:
project
)
...
...
@@ -45,9 +43,11 @@ describe NotesFinder do
context
'on restricted projects'
do
let
(
:project
)
do
create
(
:empty_project
,
:public
,
issues_access_level:
ProjectFeature
::
PRIVATE
,
snippets_access_level:
ProjectFeature
::
PRIVATE
,
merge_requests_access_level:
ProjectFeature
::
PRIVATE
)
create
(
:empty_project
,
:public
,
:issues_private
,
:snippets_private
,
:merge_requests_private
)
end
it
'publicly excludes notes on merge requests'
do
...
...
spec/helpers/projects_helper_spec.rb
View file @
3deb66ea
...
...
@@ -203,7 +203,6 @@ describe ProjectsHelper do
context
"when project moves from public to private"
do
before
do
project
.
project_feature
.
update_attributes
(
issues_access_level:
ProjectFeature
::
ENABLED
)
project
.
update_attributes
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
)
end
...
...
spec/lib/gitlab/contributions_calendar_spec.rb
View file @
3deb66ea
...
...
@@ -17,7 +17,7 @@ describe Gitlab::ContributionsCalendar do
end
let
(
:feature_project
)
do
create
(
:empty_project
,
:public
,
issues_access_level:
ProjectFeature
::
PRIVATE
)
do
|
project
|
create
(
:empty_project
,
:public
,
:issues_private
)
do
|
project
|
create
(
:project_member
,
user:
contributor
,
project:
project
).
project
end
end
...
...
spec/lib/gitlab/git_access_spec.rb
View file @
3deb66ea
...
...
@@ -94,8 +94,6 @@ describe Gitlab::GitAccess, lib: true do
context
'when repository is enabled'
do
it
'give access to download code'
do
public_project
.
project_feature
.
update_attribute
(
:repository_access_level
,
ProjectFeature
::
ENABLED
)
expect
(
subject
.
allowed?
).
to
be_truthy
end
end
...
...
spec/lib/gitlab/git_access_wiki_spec.rb
View file @
3deb66ea
...
...
@@ -36,8 +36,6 @@ describe Gitlab::GitAccessWiki, lib: true do
context
'when wiki feature is enabled'
do
it
'give access to download wiki code'
do
project
.
project_feature
.
update_attribute
(
:wiki_access_level
,
ProjectFeature
::
ENABLED
)
expect
(
subject
.
allowed?
).
to
be_truthy
end
end
...
...
spec/lib/gitlab/github_import/importer_spec.rb
View file @
3deb66ea
...
...
@@ -202,7 +202,7 @@ describe Gitlab::GithubImport::Importer, lib: true do
end
end
let
(
:project
)
{
create
(
:project
,
import_url:
"
#{
repo_root
}
/octocat/Hello-World.git"
,
wiki_access_level:
ProjectFeature
::
DISABLED
)
}
let
(
:project
)
{
create
(
:project
,
:wiki_disabled
,
import_url:
"
#{
repo_root
}
/octocat/Hello-World.git"
)
}
let
(
:credentials
)
{
{
user:
'joe'
}
}
context
'when importing a GitHub project'
do
...
...
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
View file @
3deb66ea
...
...
@@ -6,7 +6,7 @@ describe Gitlab::ImportExport::ProjectTreeRestorer, services: true do
let
(
:user
)
{
create
(
:user
)
}
let
(
:namespace
)
{
create
(
:namespace
,
owner:
user
)
}
let
(
:shared
)
{
Gitlab
::
ImportExport
::
Shared
.
new
(
relative_path:
""
,
project_path:
'path'
)
}
let!
(
:project
)
{
create
(
:empty_project
,
name:
'project'
,
path:
'project'
,
builds_access_level:
ProjectFeature
::
DISABLED
,
issues_access_level:
ProjectFeature
::
DISABLED
)
}
let!
(
:project
)
{
create
(
:empty_project
,
:builds_disabled
,
:issues_disabled
,
name:
'project'
,
path:
'project'
)
}
let
(
:project_tree_restorer
)
{
described_class
.
new
(
user:
user
,
shared:
shared
,
project:
project
)
}
let
(
:restored_project_json
)
{
project_tree_restorer
.
restore
}
...
...
@@ -121,13 +121,13 @@ describe Gitlab::ImportExport::ProjectTreeRestorer, services: true do
end
context
'with group'
do
let!
(
:project
)
do
let!
(
:project
)
do
create
(
:empty_project
,
name:
'project'
,
path:
'project'
,
builds_access_level:
ProjectFeature
::
DISABLED
,
issues_access_level:
ProjectFeature
::
DISABLED
,
group:
create
(
:group
))
:builds_disabled
,
:issues_disabled
,
name:
'project'
,
path:
'project'
,
group:
create
(
:group
))
end
it
'has group labels'
do
...
...
spec/lib/gitlab/import_export/project_tree_saver_spec.rb
View file @
3deb66ea
...
...
@@ -152,6 +152,9 @@ describe Gitlab::ImportExport::ProjectTreeSaver, services: true do
project
=
create
(
:project
,
:public
,
:repository
,
:issues_disabled
,
:wiki_enabled
,
:builds_private
,
issues:
[
issue
],
snippets:
[
snippet
],
releases:
[
release
],
...
...
@@ -185,10 +188,6 @@ describe Gitlab::ImportExport::ProjectTreeSaver, services: true do
create
(
:event
,
:created
,
target:
milestone
,
project:
project
,
author:
user
)
create
(
:service
,
project:
project
,
type:
'CustomIssueTrackerService'
,
category:
'issue_tracker'
)
project
.
project_feature
.
update_attribute
(
:issues_access_level
,
ProjectFeature
::
DISABLED
)
project
.
project_feature
.
update_attribute
(
:wiki_access_level
,
ProjectFeature
::
ENABLED
)
project
.
project_feature
.
update_attribute
(
:builds_access_level
,
ProjectFeature
::
PRIVATE
)
project
end
...
...
spec/lib/gitlab/project_search_results_spec.rb
View file @
3deb66ea
...
...
@@ -163,7 +163,7 @@ describe Gitlab::ProjectSearchResults, lib: true do
end
it
"doesn't list issue notes when access is restricted"
do
project
=
create
(
:empty_project
,
:public
,
issues_access_level:
ProjectFeature
::
PRIVATE
)
project
=
create
(
:empty_project
,
:public
,
:issues_private
)
note
=
create
(
:note_on_issue
,
project:
project
)
results
=
described_class
.
new
(
user
,
project
,
note
.
note
)
...
...
@@ -172,7 +172,7 @@ describe Gitlab::ProjectSearchResults, lib: true do
end
it
"doesn't list merge_request notes when access is restricted"
do
project
=
create
(
:empty_project
,
:public
,
merge_requests_access_level:
ProjectFeature
::
PRIVATE
)
project
=
create
(
:empty_project
,
:public
,
:merge_requests_private
)
note
=
create
(
:note_on_merge_request
,
project:
project
)
results
=
described_class
.
new
(
user
,
project
,
note
.
note
)
...
...
spec/models/ability_spec.rb
View file @
3deb66ea
...
...
@@ -247,7 +247,7 @@ describe Ability, lib: true do
end
describe
'.project_disabled_features_rules'
do
let
(
:project
)
{
create
(
:empty_project
,
wiki_access_level:
ProjectFeature
::
DISABLED
)
}
let
(
:project
)
{
create
(
:empty_project
,
:wiki_disabled
)
}
subject
{
described_class
.
allowed
(
project
.
owner
,
project
)
}
...
...
spec/models/guest_spec.rb
View file @
3deb66ea
...
...
@@ -37,8 +37,6 @@ describe Guest, lib: true do
context
'when repository is enabled'
do
it
'allows to pull the repo'
do
public_project
.
project_feature
.
update_attribute
(
:repository_access_level
,
ProjectFeature
::
ENABLED
)
expect
(
Guest
.
can?
(
:download_code
,
public_project
)).
to
eq
(
true
)
end
end
...
...
spec/models/project_feature_spec.rb
View file @
3deb66ea
...
...
@@ -57,7 +57,6 @@ describe ProjectFeature do
context
'when feature is enabled for everyone'
do
it
"returns true"
do
features
.
each
do
|
feature
|
project
.
project_feature
.
update_attribute
(
"
#{
feature
}
_access_level"
.
to_sym
,
ProjectFeature
::
ENABLED
)
expect
(
project
.
feature_available?
(
:issues
,
user
)).
to
eq
(
true
)
end
end
...
...
@@ -104,7 +103,6 @@ describe ProjectFeature do
it
"returns true when feature is enabled for everyone"
do
features
.
each
do
|
feature
|
project
.
project_feature
.
update_attribute
(
"
#{
feature
}
_access_level"
.
to_sym
,
ProjectFeature
::
ENABLED
)
expect
(
project
.
public_send
(
"
#{
feature
}
_enabled?"
)).
to
eq
(
true
)
end
end
...
...
spec/models/project_spec.rb
View file @
3deb66ea
...
...
@@ -632,7 +632,7 @@ describe Project, models: true do
end
describe
'#has_wiki?'
do
let
(
:no_wiki_project
)
{
create
(
:empty_project
,
wiki_access_level:
ProjectFeature
::
DISABLED
,
has_external_wiki:
false
)
}
let
(
:no_wiki_project
)
{
create
(
:empty_project
,
:wiki_disabled
,
has_external_wiki:
false
)
}
let
(
:wiki_enabled_project
)
{
create
(
:empty_project
)
}
let
(
:external_wiki_project
)
{
create
(
:empty_project
,
has_external_wiki:
true
)
}
...
...
spec/models/user_spec.rb
View file @
3deb66ea
...
...
@@ -1232,7 +1232,7 @@ describe User, models: true do
end
it
'does not include projects for which issues are disabled'
do
project
=
create
(
:empty_project
,
issues_access_level:
ProjectFeature
::
DISABLED
)
project
=
create
(
:empty_project
,
:issues_disabled
)
expect
(
user
.
projects_where_can_admin_issues
.
to_a
).
to
be_empty
expect
(
user
.
can?
(
:admin_issue
,
project
)).
to
eq
(
false
)
...
...
spec/requests/api/issues_spec.rb
View file @
3deb66ea
...
...
@@ -425,7 +425,7 @@ describe API::Issues, api: true do
end
it
'returns no issues when user has access to project but not issues'
do
restricted_project
=
create
(
:empty_project
,
:public
,
issues_access_level:
ProjectFeature
::
PRIVATE
)
restricted_project
=
create
(
:empty_project
,
:public
,
:issues_private
)
create
(
:issue
,
project:
restricted_project
)
get
api
(
"/projects/
#{
restricted_project
.
id
}
/issues"
,
non_member
)
...
...
spec/requests/git_http_spec.rb
View file @
3deb66ea
...
...
@@ -57,7 +57,7 @@ describe 'Git HTTP requests', lib: true do
end
context
'but the repo is disabled'
do
let
(
:project
)
{
create
(
:project
,
repository_access_level:
ProjectFeature
::
DISABLED
,
wiki_access_level:
ProjectFeature
::
ENABLED
)
}
let
(
:project
)
{
create
(
:project
,
:repository_disabled
,
:wiki_enabled
)
}
let
(
:wiki
)
{
ProjectWiki
.
new
(
project
)
}
let
(
:path
)
{
"/
#{
wiki
.
repository
.
path_with_namespace
}
.git"
}
...
...
@@ -141,7 +141,7 @@ describe 'Git HTTP requests', lib: true do
context
'when the repo is public'
do
context
'but the repo is disabled'
do
it
'does not allow to clone the repo'
do
project
=
create
(
:project
,
:public
,
repository_access_level:
ProjectFeature
::
DISABLED
)
project
=
create
(
:project
,
:public
,
:repository_disabled
)
download
(
"
#{
project
.
path_with_namespace
}
.git"
,
{})
do
|
response
|
expect
(
response
).
to
have_http_status
(
:unauthorized
)
...
...
@@ -151,7 +151,7 @@ describe 'Git HTTP requests', lib: true do
context
'but the repo is enabled'
do
it
'allows to clone the repo'
do
project
=
create
(
:project
,
:public
,
repository_access_level:
ProjectFeature
::
ENABLED
)
project
=
create
(
:project
,
:public
,
:repository_enabled
)
download
(
"
#{
project
.
path_with_namespace
}
.git"
,
{})
do
|
response
|
expect
(
response
).
to
have_http_status
(
:ok
)
...
...
@@ -161,7 +161,7 @@ describe 'Git HTTP requests', lib: true do
context
'but only project members are allowed'
do
it
'does not allow to clone the repo'
do
project
=
create
(
:project
,
:public
,
repository_access_level:
ProjectFeature
::
PRIVATE
)
project
=
create
(
:project
,
:public
,
:repository_private
)
download
(
"
#{
project
.
path_with_namespace
}
.git"
,
{})
do
|
response
|
expect
(
response
).
to
have_http_status
(
:unauthorized
)
...
...
@@ -360,10 +360,6 @@ describe 'Git HTTP requests', lib: true do
let
(
:project
)
{
build
.
project
}
let
(
:other_project
)
{
create
(
:empty_project
)
}
before
do
project
.
project_feature
.
update_attributes
(
builds_access_level:
ProjectFeature
::
ENABLED
)
end
context
'when build created by system is authenticated'
do
it
"downloads get status 200"
do
clone_get
"
#{
project
.
path_with_namespace
}
.git"
,
user:
'gitlab-ci-token'
,
password:
build
.
token
...
...
spec/services/projects/create_service_spec.rb
View file @
3deb66ea
...
...
@@ -90,10 +90,6 @@ describe Projects::CreateService, '#execute', services: true do
end
context
'global builds_enabled true does enable CI by default'
do
before
do
project
.
project_feature
.
update_attribute
(
:builds_access_level
,
ProjectFeature
::
ENABLED
)
end
it
{
is_expected
.
to
be_truthy
}
end
end
...
...
spec/support/services/issuable_create_service_shared_examples.rb
View file @
3deb66ea
...
...
@@ -31,8 +31,8 @@ shared_examples 'issuable create service' do
context
"when issuable feature is private"
do
before
do
project
.
project_feature
.
update
(
issues_access_level:
ProjectFeature
::
PRIVATE
)
project
.
project_feature
.
update
(
merge_requests_access_level:
ProjectFeature
::
PRIVATE
)
project
.
project_feature
.
update
(
issues_access_level:
ProjectFeature
::
PRIVATE
,
merge_requests_access_level:
ProjectFeature
::
PRIVATE
)
end
levels
=
[
Gitlab
::
VisibilityLevel
::
INTERNAL
,
Gitlab
::
VisibilityLevel
::
PUBLIC
]
...
...
spec/workers/repository_check/single_repository_worker_spec.rb
View file @
3deb66ea
...
...
@@ -5,7 +5,7 @@ describe RepositoryCheck::SingleRepositoryWorker do
subject
{
described_class
.
new
}
it
'passes when the project has no push events'
do
project
=
create
(
:project_empty_repo
,
wiki_access_level:
ProjectFeature
::
DISABLED
)
project
=
create
(
:project_empty_repo
,
:wiki_disabled
)
project
.
events
.
destroy_all
break_repo
(
project
)
...
...
@@ -25,7 +25,7 @@ describe RepositoryCheck::SingleRepositoryWorker do
end
it
'fails if the wiki repository is broken'
do
project
=
create
(
:project_empty_repo
,
wiki_access_level:
ProjectFeature
::
ENABLED
)
project
=
create
(
:project_empty_repo
,
:wiki_enabled
)
project
.
create_wiki
# Test sanity: everything should be fine before the wiki repo is broken
...
...
@@ -39,7 +39,7 @@ describe RepositoryCheck::SingleRepositoryWorker do
end
it
'skips wikis when disabled'
do
project
=
create
(
:project_empty_repo
,
wiki_access_level:
ProjectFeature
::
DISABLED
)
project
=
create
(
:project_empty_repo
,
:wiki_disabled
)
# Make sure the test would fail if the wiki repo was checked
break_wiki
(
project
)
...
...
@@ -49,7 +49,7 @@ describe RepositoryCheck::SingleRepositoryWorker do
end
it
'creates missing wikis'
do
project
=
create
(
:project_empty_repo
,
wiki_access_level:
ProjectFeature
::
ENABLED
)
project
=
create
(
:project_empty_repo
,
:wiki_enabled
)
FileUtils
.
rm_rf
(
wiki_path
(
project
))
subject
.
perform
(
project
.
id
)
...
...
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