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
0ea75043
Commit
0ea75043
authored
Apr 01, 2019
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[EE] Reduce diff with CE in spec/models/project_feature_spec.rb
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
201c329a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
9 deletions
+23
-9
ee/spec/models/project_feature_spec.rb
ee/spec/models/project_feature_spec.rb
+23
-0
spec/models/project_feature_spec.rb
spec/models/project_feature_spec.rb
+0
-9
No files found.
ee/spec/models/project_feature_spec.rb
0 → 100644
View file @
0ea75043
# frozen_string_literal: true
require
'spec_helper'
describe
ProjectFeature
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
describe
'#feature_available?'
do
let
(
:features
)
{
%w(issues wiki builds merge_requests snippets repository pages)
}
context
'when features are enabled only for team members'
do
it
"returns true if user is an auditor"
do
user
.
update_attribute
(
:auditor
,
true
)
features
.
each
do
|
feature
|
project
.
project_feature
.
update_attribute
(
"
#{
feature
}
_access_level"
.
to_sym
,
ProjectFeature
::
PRIVATE
)
expect
(
project
.
feature_available?
(
:issues
,
user
)).
to
eq
(
true
)
end
end
end
end
end
spec/models/project_feature_spec.rb
View file @
0ea75043
...
...
@@ -66,15 +66,6 @@ describe ProjectFeature do
expect
(
project
.
feature_available?
(
:issues
,
user
)).
to
eq
(
true
)
end
end
it
"returns true if user is an auditor"
do
user
.
update_attribute
(
:auditor
,
true
)
features
.
each
do
|
feature
|
project
.
project_feature
.
update_attribute
(
"
#{
feature
}
_access_level"
.
to_sym
,
ProjectFeature
::
PRIVATE
)
expect
(
project
.
feature_available?
(
:issues
,
user
)).
to
eq
(
true
)
end
end
end
context
'when feature is enabled for everyone'
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