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
80a68d68
Commit
80a68d68
authored
Oct 02, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for namespace plans-related methods
parent
6453eca1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
db/fixtures/test/01_plan.rb
db/fixtures/test/01_plan.rb
+3
-0
spec/ee/spec/models/ee/namespace_spec.rb
spec/ee/spec/models/ee/namespace_spec.rb
+38
-0
No files found.
db/fixtures/test/01_plan.rb
View file @
80a68d68
require
'./spec/support/sidekiq'
require
'./spec/support/sidekiq'
Plan
.
create!
(
name:
EE
::
Namespace
::
FREE_PLAN
,
title:
EE
::
Namespace
::
FREE_PLAN
.
titleize
)
EE
::
Namespace
::
EE_PLANS
.
each_key
do
|
plan
|
EE
::
Namespace
::
EE_PLANS
.
each_key
do
|
plan
|
Plan
.
create!
(
name:
plan
,
title:
plan
.
titleize
)
Plan
.
create!
(
name:
plan
,
title:
plan
.
titleize
)
end
end
spec/ee/spec/models/ee/namespace_spec.rb
View file @
80a68d68
...
@@ -352,4 +352,42 @@ describe Namespace do
...
@@ -352,4 +352,42 @@ describe Namespace do
expect
(
very_deep_nested_group
.
root_ancestor
).
to
eq
(
root_group
)
expect
(
very_deep_nested_group
.
root_ancestor
).
to
eq
(
root_group
)
end
end
end
end
describe
'#actual_plan'
do
context
'when namespace has a plan associated'
do
before
do
namespace
.
plan
=
Namespace
::
GOLD_PLAN
end
it
'returns an associated plan'
do
expect
(
namespace
.
plan
).
not_to
be_nil
expect
(
namespace
.
actual_plan
.
name
).
to
eq
'gold'
end
end
context
'when namespace does not have plan associated'
do
it
'returns a free plan object'
do
expect
(
namespace
.
plan
).
to
be_nil
expect
(
namespace
.
actual_plan
.
name
).
to
eq
'free'
end
end
end
describe
'#actual_plan_name'
do
context
'when namespace has a plan associated'
do
before
do
namespace
.
plan
=
Namespace
::
GOLD_PLAN
end
it
'returns an associated plan name'
do
expect
(
namespace
.
actual_plan_name
).
to
eq
'gold'
end
end
context
'when namespace does not have plan associated'
do
it
'returns a free plan name'
do
expect
(
namespace
.
actual_plan_name
).
to
eq
'free'
end
end
end
end
end
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