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
3863e46b
Commit
3863e46b
authored
Jun 19, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Project#feature_available? specs
parent
16e88fff
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
42 deletions
+46
-42
spec/models/ee/project_spec.rb
spec/models/ee/project_spec.rb
+46
-42
No files found.
spec/models/ee/project_spec.rb
View file @
3863e46b
...
@@ -22,15 +22,16 @@ describe Project, models: true do
...
@@ -22,15 +22,16 @@ describe Project, models: true do
before
do
before
do
stub_application_setting
(
'check_namespace_plan?'
=>
check_namespace_plan
)
stub_application_setting
(
'check_namespace_plan?'
=>
check_namespace_plan
)
allow
(
Gitlab
).
to
receive
(
:com?
)
{
true
}
allow
(
Gitlab
).
to
receive
(
:com?
)
{
true
}
expect
_any_instance_of
(
License
).
to
receive
(
:feature_available?
).
with
(
feature
)
{
allowed_on_global_license
}
expect
(
License
).
to
receive
(
:feature_available?
).
with
(
feature
)
{
allowed_on_global_license
}
allow
(
namespace
).
to
receive
(
:plan
)
{
plan_license
}
allow
(
namespace
).
to
receive
(
:plan
)
{
plan_license
}
end
end
License
::
FEATURE_CODES
.
each
do
|
feature_sym
,
feature_code
|
License
::
FEATURE_CODES
.
each
do
|
feature_sym
,
feature_code
|
context
feature_sym
.
to_s
do
let
(
:feature
)
{
feature_sym
}
let
(
:feature
)
{
feature_sym
}
let
(
:feature_code
)
{
feature_code
}
let
(
:feature_code
)
{
feature_code
}
context
"checking
#{
feature
}
availabil
y both on Global and Namespace license"
do
context
"checking
#{
feature_sym
}
availabilit
y both on Global and Namespace license"
do
let
(
:check_namespace_plan
)
{
true
}
let
(
:check_namespace_plan
)
{
true
}
context
'allowed by Plan License AND Global License'
do
context
'allowed by Plan License AND Global License'
do
...
@@ -54,6 +55,7 @@ describe Project, models: true do
...
@@ -54,6 +55,7 @@ describe Project, models: true do
end
end
end
end
unless
License
.
plan_includes_feature?
(
License
::
STARTER_PLAN
,
feature_sym
)
context
'not allowed by Plan License'
do
context
'not allowed by Plan License'
do
let
(
:allowed_on_global_license
)
{
true
}
let
(
:allowed_on_global_license
)
{
true
}
let
(
:plan_license
)
{
Namespace
::
BRONZE_PLAN
}
let
(
:plan_license
)
{
Namespace
::
BRONZE_PLAN
}
...
@@ -62,6 +64,7 @@ describe Project, models: true do
...
@@ -62,6 +64,7 @@ describe Project, models: true do
is_expected
.
to
eq
(
false
)
is_expected
.
to
eq
(
false
)
end
end
end
end
end
context
'not allowed by Global License'
do
context
'not allowed by Global License'
do
let
(
:allowed_on_global_license
)
{
false
}
let
(
:allowed_on_global_license
)
{
false
}
...
@@ -94,6 +97,7 @@ describe Project, models: true do
...
@@ -94,6 +97,7 @@ describe Project, models: true do
end
end
end
end
end
end
end
context
'when feature symbol is not included on Namespace features code'
do
context
'when feature symbol is not included on Namespace features code'
do
let
(
:feature
)
{
:issues
}
let
(
:feature
)
{
:issues
}
...
...
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