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
09639474
Commit
09639474
authored
Mar 29, 2019
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update specs for new permissions
And implement review feedback
parent
16862386
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
12 deletions
+39
-12
ee/app/models/ee/project.rb
ee/app/models/ee/project.rb
+1
-1
ee/spec/features/projects/issues/design_management/user_uploads_designs_spec.rb
...cts/issues/design_management/user_uploads_designs_spec.rb
+30
-9
ee/spec/features/projects/issues/design_management/user_views_design_spec.rb
...ojects/issues/design_management/user_views_design_spec.rb
+2
-0
ee/spec/features/projects/issues/design_management/user_views_designs_spec.rb
...jects/issues/design_management/user_views_designs_spec.rb
+2
-0
ee/spec/policies/design_management/design_policy_spec.rb
ee/spec/policies/design_management/design_policy_spec.rb
+1
-1
spec/graphql/types/permission_types/issue_spec.rb
spec/graphql/types/permission_types/issue_spec.rb
+3
-1
No files found.
ee/app/models/ee/project.rb
View file @
09639474
...
...
@@ -579,7 +579,7 @@ module EE
# Checking both feature availability on the license, as well as the feature
# flag, because we don't want to enable design_management by default on
# on prem installs yet.
feature_available?
(
:design_management
)
&&
::
Feature
.
enabled?
(
:design_management
)
feature_available?
(
:design_management
)
&&
::
Feature
.
enabled?
(
:design_management
,
self
)
end
private
...
...
ee/spec/features/projects/issues/design_management/user_uploads_designs_spec.rb
View file @
09639474
require
'spec_helper'
describe
'User uploads new design'
,
:js
do
let
(
:user
)
{
project
.
owner
}
let
(
:project
)
{
create
(
:project_empty_repo
,
:public
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
before
do
visit
project_issue_path
(
project
,
issue
)
sign_in
(
user
)
end
context
"when the feature is available"
do
before
do
stub_licensed_features
(
design_management:
true
)
visit
project_issue_path
(
project
,
issue
)
click_link
'Designs'
click_link
'Designs'
wait_for_requests
end
wait_for_requests
it
'uploads design'
do
attach_file
(
:design_file
,
logo_fixture
,
make_visible:
true
)
expect
(
page
).
to
have_selector
(
'.js-design-list-item'
,
count:
6
)
within
first
(
'#designs-tab .card'
)
do
expect
(
page
).
to
have_content
(
'dk.png'
)
expect
(
page
).
to
have_content
(
'Updated just now'
)
end
end
end
it
'uploads design'
do
attach_file
(
:design_file
,
logo_fixture
,
make_visible:
true
)
context
'when the feature is not available'
do
before
do
stub_licensed_features
(
design_management:
false
)
expect
(
page
).
to
have_selector
(
'.js-design-list-item'
,
count:
6
)
visit
project_issue_path
(
project
,
issue
)
end
within
first
(
'#designs-tab .card'
)
do
expect
(
page
).
to
have_content
(
'dk.png'
)
expect
(
page
).
to
have_content
(
'Updated just now'
)
it
'does not show the designs link'
do
expect
(
page
).
not_to
have_link
(
'Designs'
)
end
end
...
...
ee/spec/features/projects/issues/design_management/user_views_design_spec.rb
View file @
09639474
...
...
@@ -5,6 +5,8 @@ describe 'User views issue designs', :js do
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
before
do
stub_licensed_features
(
design_management:
true
)
visit
project_issue_path
(
project
,
issue
)
click_link
'Designs'
...
...
ee/spec/features/projects/issues/design_management/user_views_designs_spec.rb
View file @
09639474
...
...
@@ -5,6 +5,8 @@ describe 'User views issue designs', :js do
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
before
do
stub_licensed_features
(
design_management:
true
)
visit
project_issue_path
(
project
,
issue
)
click_link
'Designs'
...
...
ee/spec/policies/design_management/design_policy_spec.rb
View file @
09639474
...
...
@@ -146,7 +146,7 @@ describe DesignManagement::DesignPolicy do
context
"for anonymous users"
do
let
(
:current_user
)
{
nil
}
it
{
is_expected
.
to
be_disallowed
(
*
design_abilities
)}
it
{
is_expected
.
to
be_disallowed
(
*
design_abilities
)
}
end
end
end
...
...
spec/graphql/types/permission_types/issue_spec.rb
View file @
09639474
...
...
@@ -7,6 +7,8 @@ describe Types::PermissionTypes::Issue do
:create_note
,
:reopen_issue
]
expect
(
described_class
).
to
have_graphql_fields
(
expected_permissions
)
expected_permissions
.
each
do
|
permission
|
expect
(
described_class
).
to
have_graphql_field
(
permission
)
end
end
end
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