Commit 3edf67c8 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'ag-273028-confidential-issue' into 'master'

Add licenses helper

See merge request gitlab-org/gitlab!57130
parents 96a0071c a94aa40d
......@@ -48,5 +48,11 @@ module LicenseHelper
end
end
def cloud_license_view_data
{
current_plan_title: current_license_title
}
end
extend self
end
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment