Skip to content
Snippets Groups Projects
Commit bbb67df4 authored by Nick Thomas's avatar Nick Thomas
Browse files

Treat licenses with no plan specified as EES

parent a69be90a
No related branches found
No related tags found
1 merge request!2108Add explicit licensing for Elasticsearch
Loading
Loading
@@ -187,7 +187,7 @@ def previous_user_count
end
 
def plan
restricted_attr(:plan)
restricted_attr(:plan, STARTER_PLAN)
end
 
def current_active_users_count
Loading
Loading
Loading
Loading
@@ -344,6 +344,20 @@
end
 
describe 'reading add-ons' do
describe '#plan' do
it 'interprets no plan as EES' do
license = build(:license, data: build(:gitlab_license, restrictions: { add_ons: {} }).export)
expect(license.plan).to eq(License::STARTER_PLAN)
end
it 'interprets an unknown plan as unknown' do
license = build_license_with_add_ons({}, plan: 'unknown')
expect(license.plan).to eq('unknown')
end
end
describe '#add_ons' do
context 'without add-ons' do
it 'returns an empty Hash' do
Loading
Loading
Loading
Loading
@@ -17,7 +17,7 @@
expect(Date.parse(json_response['expires_at'])).to eq Date.today + 11.months
expect(json_response['active_users']).to eq 1
expect(json_response['licensee']).not_to be_empty
expect(json_response['add_ons']).to eq({ 'GitLab_FileLocks' => 1, 'GitLab_Auditor_User' => 1 })
expect(json_response['add_ons']).to eq(license.add_ons)
end
 
it 'denies access if not admin' do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment