Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
8ba4162b
Commit
8ba4162b
authored
Aug 27, 2018
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make packages_enabled= method public
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
6e157c65
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
13 deletions
+14
-13
ee/app/models/ee/project.rb
ee/app/models/ee/project.rb
+9
-9
ee/spec/features/projects/settings/packages_settings_spec.rb
ee/spec/features/projects/settings/packages_settings_spec.rb
+3
-3
lib/gitlab/import_export/import_export.yml
lib/gitlab/import_export/import_export.yml
+1
-0
spec/features/projects/features_visibility_spec.rb
spec/features/projects/features_visibility_spec.rb
+1
-1
No files found.
ee/app/models/ee/project.rb
View file @
8ba4162b
...
...
@@ -539,6 +539,15 @@ module EE
Feature
.
enabled?
(
'protected_environments'
)
&&
feature_available?
(
:protected_environments
)
end
# Because we use default_value_for we need to be sure
# packages_enabled= method does exist even if we rollback migration.
# Otherwise many tests from spec/migrations will fail.
def
packages_enabled
=
(
value
)
if
has_attribute?
(
:packages_enabled
)
write_attribute
(
:packages_enabled
,
value
)
end
end
private
def
set_override_pull_mirror_available
...
...
@@ -592,14 +601,5 @@ module EE
old_path_with_namespace:
full_path_before
).
create
end
# Because we use default_value_for we need to be sure
# packages_enabled= method does exist even if we rollback migration.
# Otherwise many tests from spec/migrations will fail.
def
packages_enabled
=
(
value
)
if
has_attribute?
(
:packages_enabled
)
write_attribute
(
:packages_enabled
,
value
)
end
end
end
end
ee/spec/features/projects/settings/packages_settings_spec.rb
View file @
8ba4162b
...
...
@@ -14,7 +14,7 @@ describe 'Projects > Settings > Packages', :js do
allow
(
Gitlab
.
config
.
packages
).
to
receive
(
:enabled
).
and_return
(
true
)
end
it
'displays the
correct elements
'
do
it
'displays the
packages toggle button
'
do
visit
edit_project_path
(
project
)
expect
(
page
).
to
have_content
(
'Packages'
)
...
...
@@ -27,10 +27,10 @@ describe 'Projects > Settings > Packages', :js do
allow
(
Gitlab
.
config
.
packages
).
to
receive
(
:enabled
).
and_return
(
false
)
end
it
'd
isplays the correct elements
'
do
it
'd
oes not show up in UI
'
do
visit
edit_project_path
(
project
)
expect
(
page
).
to_not
have_content
(
'Packages'
)
expect
(
page
).
not_to
have_content
(
'Packages'
)
end
end
end
lib/gitlab/import_export/import_export.yml
View file @
8ba4162b
...
...
@@ -119,6 +119,7 @@ excluded_attributes:
-
:mirror_overwrites_diverged_branches
-
:description_html
-
:repository_languages
-
:packages_enabled
snippets
:
-
:expired_at
merge_request_diff
:
...
...
spec/features/projects/features_visibility_spec.rb
View file @
8ba4162b
...
...
@@ -177,7 +177,7 @@ describe 'Edit Project Settings' do
click_button
"Save changes"
end
expect
(
find
(
".sharing-permissions"
)).
to
have_selector
(
".project-feature-toggle.is-disabled"
,
count:
2
)
expect
(
find
(
".sharing-permissions"
)).
to
have_selector
(
".project-feature-toggle.is-disabled"
,
count:
4
)
end
it
"shows empty features project homepage"
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment