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
e18c287a
Commit
e18c287a
authored
Mar 26, 2019
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[EE] Reduce the diff with CE in spec/policies/namespace_policy_spec.rb
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
5f47dabf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
15 deletions
+25
-15
ee/spec/policies/namespace_policy_spec.rb
ee/spec/policies/namespace_policy_spec.rb
+25
-0
spec/policies/namespace_policy_spec.rb
spec/policies/namespace_policy_spec.rb
+0
-15
No files found.
ee/spec/policies/namespace_policy_spec.rb
0 → 100644
View file @
e18c287a
# frozen_string_literal: true
require
'spec_helper'
describe
NamespacePolicy
do
let
(
:owner
)
{
create
(
:user
)
}
let
(
:namespace
)
{
create
(
:namespace
,
owner:
owner
)
}
let
(
:owner_permissions
)
{
[
:create_projects
,
:admin_namespace
,
:read_namespace
]
}
subject
{
described_class
.
new
(
current_user
,
namespace
)
}
context
'auditor'
do
let
(
:current_user
)
{
create
(
:user
,
:auditor
)
}
context
'owner'
do
let
(
:namespace
)
{
create
(
:namespace
,
owner:
current_user
)
}
it
{
is_expected
.
to
be_allowed
(
*
owner_permissions
)
}
end
context
'non-owner'
do
it
{
is_expected
.
to
be_disallowed
(
*
owner_permissions
)
}
end
end
end
spec/policies/namespace_policy_spec.rb
View file @
e18c287a
...
...
@@ -3,7 +3,6 @@ require 'spec_helper'
describe
NamespacePolicy
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:owner
)
{
create
(
:user
)
}
let
(
:auditor
)
{
create
(
:user
,
:auditor
)
}
let
(
:admin
)
{
create
(
:admin
)
}
let
(
:namespace
)
{
create
(
:namespace
,
owner:
owner
)
}
...
...
@@ -35,20 +34,6 @@ describe NamespacePolicy do
end
end
context
'auditor'
do
let
(
:current_user
)
{
auditor
}
context
'owner'
do
let
(
:namespace
)
{
create
(
:namespace
,
owner:
auditor
)
}
it
{
is_expected
.
to
be_allowed
(
*
owner_permissions
)
}
end
context
'non-owner'
do
it
{
is_expected
.
to
be_disallowed
(
*
owner_permissions
)
}
end
end
context
'admin'
do
let
(
:current_user
)
{
admin
}
...
...
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