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
c5e882ff
Commit
c5e882ff
authored
Sep 17, 2018
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the `stub_licensed_features` helper in specs
Reuse an existing helper to enable and disable licensed features
parent
cb78be1a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
ee/spec/features/projects/settings/protected_environments_spec.rb
...features/projects/settings/protected_environments_spec.rb
+2
-2
ee/spec/models/ee/environment_spec.rb
ee/spec/models/ee/environment_spec.rb
+2
-4
No files found.
ee/spec/features/projects/settings/protected_environments_spec.rb
View file @
c5e882ff
...
...
@@ -8,8 +8,8 @@ describe 'Protected Environments' do
let
(
:environments
)
{
%w(production development staging test)
}
before
do
allow
(
License
).
to
receive
(
:feature_available?
).
and_call_original
allow
(
License
).
to
receive
(
:feature_available?
).
with
(
:protected_environments
).
and_return
(
true
)
stub_licensed_features
(
protected_environments:
true
)
environments
.
each
do
|
environment_name
|
create
(
:environment
,
name:
environment_name
,
project:
project
)
end
...
...
ee/spec/models/ee/environment_spec.rb
View file @
c5e882ff
...
...
@@ -29,8 +29,7 @@ describe Environment do
subject
{
environment
.
protected?
}
before
do
allow
(
project
).
to
receive
(
:feature_available?
)
.
with
(
:protected_environments
).
and_return
(
feature_available
)
stub_licensed_features
(
protected_environments:
feature_available
)
end
context
'when Protected Environments feature is not available on the project'
do
...
...
@@ -63,8 +62,7 @@ describe Environment do
subject
{
environment
.
protected_deployable_by_user?
(
user
)
}
before
do
allow
(
project
).
to
receive
(
:feature_available?
)
.
with
(
:protected_environments
).
and_return
(
feature_available
)
stub_licensed_features
(
protected_environments:
true
)
end
context
'when Protected Environments feature is not available on the project'
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