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
3edf67c8
Commit
3edf67c8
authored
Mar 26, 2021
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ag-273028-confidential-issue' into 'master'
Add licenses helper See merge request gitlab-org/gitlab!57130
parents
96a0071c
a94aa40d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
ee/app/helpers/license_helper.rb
ee/app/helpers/license_helper.rb
+6
-0
ee/spec/helpers/license_helper_spec.rb
ee/spec/helpers/license_helper_spec.rb
+20
-0
No files found.
ee/app/helpers/license_helper.rb
View file @
3edf67c8
...
...
@@ -48,5 +48,11 @@ module LicenseHelper
end
end
def
cloud_license_view_data
{
current_plan_title:
current_license_title
}
end
extend
self
end
ee/spec/helpers/license_helper_spec.rb
View file @
3edf67c8
...
...
@@ -78,4 +78,24 @@ RSpec.describe LicenseHelper do
end
end
end
describe
'#cloud_license_view_data'
do
context
'when there is a current license'
do
it
'returns the data for the view'
do
custom_plan
=
'custom plan'
license
=
double
(
'License'
,
plan:
custom_plan
)
allow
(
License
).
to
receive
(
:current
).
and_return
(
license
)
expect
(
cloud_license_view_data
).
to
eq
({
current_plan_title:
'Custom Plan'
})
end
end
context
'when there is no current license'
do
it
'returns the data for the view'
do
allow
(
License
).
to
receive
(
:current
).
and_return
(
nil
)
expect
(
cloud_license_view_data
).
to
eq
({
current_plan_title:
'Core'
})
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