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
c6afc977
Commit
c6afc977
authored
Jul 30, 2018
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Raise error when stubbing a feature that is not defined on license.rb
parent
ab4bb67f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
6 deletions
+15
-6
ee/spec/controllers/projects/boards_controller_spec.rb
ee/spec/controllers/projects/boards_controller_spec.rb
+1
-1
ee/spec/features/boards/group_boards/user_edits_issues_spec.rb
...ec/features/boards/group_boards/user_edits_issues_spec.rb
+1
-1
ee/spec/features/boards/scoped_issue_board_spec.rb
ee/spec/features/boards/scoped_issue_board_spec.rb
+4
-4
ee/spec/support/helpers/ee/license_helpers.rb
ee/spec/support/helpers/ee/license_helpers.rb
+9
-0
No files found.
ee/spec/controllers/projects/boards_controller_spec.rb
View file @
c6afc977
...
...
@@ -45,7 +45,7 @@ describe Projects::BoardsController do
describe
'POST create'
do
context
'with the multiple issue boards available'
do
before
do
stub_licensed_features
(
multiple_issue_boards:
true
)
stub_licensed_features
(
multiple_
project_
issue_boards:
true
)
end
context
'with valid params'
do
...
...
ee/spec/features/boards/group_boards/user_edits_issues_spec.rb
View file @
c6afc977
...
...
@@ -12,7 +12,7 @@ describe 'label issues', :js do
let!
(
:list
)
{
create
(
:list
,
board:
board
,
label:
development
,
position:
0
)
}
before
do
stub_licensed_features
(
group_issue_boards:
true
)
stub_licensed_features
(
multiple_
group_issue_boards:
true
)
group
.
add_maintainer
(
user
)
sign_in
(
user
)
...
...
ee/spec/features/boards/scoped_issue_board_spec.rb
View file @
c6afc977
...
...
@@ -23,7 +23,7 @@ describe 'Scoped issue boards', :js do
before
do
allow_any_instance_of
(
ApplicationHelper
).
to
receive
(
:collapsed_sidebar?
).
and_return
(
true
)
stub_licensed_features
(
scoped_issue_board
s
:
true
)
stub_licensed_features
(
scoped_issue_board:
true
)
end
context
'user with edit permissions'
do
...
...
@@ -301,7 +301,7 @@ describe 'Scoped issue boards', :js do
context
'group board'
do
it
'only shows group labels in list'
do
stub_licensed_features
(
group_issue_boards:
true
)
stub_licensed_features
(
multiple_
group_issue_boards:
true
)
visit
group_boards_path
(
group
)
edit_board
.
click
...
...
@@ -419,7 +419,7 @@ describe 'Scoped issue boards', :js do
context
'with scoped_issue_boards feature disabled'
do
before
do
stub_licensed_features
(
scoped_issue_board
s
:
false
)
stub_licensed_features
(
scoped_issue_board:
false
)
project
.
add_maintainer
(
user
)
login_as
(
user
)
...
...
@@ -441,7 +441,7 @@ describe 'Scoped issue boards', :js do
# To make sure the form is shown
expect
(
page
).
to
have_field
(
'board-new-name'
)
expect
(
page
).
not_to
have_button
(
'
Toggle
'
)
expect
(
page
).
not_to
have_button
(
'
Expand
'
)
end
end
...
...
ee/spec/support/helpers/ee/license_helpers.rb
View file @
c6afc977
...
...
@@ -9,6 +9,15 @@ module EE
# This enables `geo` and disables `deploy_board` features for a spec.
# Other features are still enabled/disabled as defined in the license.
def
stub_licensed_features
(
features
)
existing_features
=
License
::
FEATURES_BY_PLAN
.
values
.
flatten
.
map
(
&
:to_sym
)
missing_features
=
features
.
keys
.
map
(
&
:to_sym
)
-
existing_features
if
missing_features
.
any?
subject
=
missing_features
.
join
(
', '
)
noun
=
'feature'
.
pluralize
(
missing_features
.
size
)
raise
ArgumentError
,
"
#{
subject
}
should be defined as licensed
#{
noun
}
"
end
allow
(
License
).
to
receive
(
:feature_available?
).
and_call_original
features
.
each
do
|
feature
,
enabled
|
...
...
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