Commit 9090d0c2 authored by Phil Hughes's avatar Phil Hughes

Merge branch '4614-fix-trial-license-expiration-duration' into 'master'

Fix license expiration duration to show trial info only for trial license

Closes #4614

See merge request gitlab-org/gitlab-ee!4573
parents 9281cf89 5f6a43a3
---
title: Fix license expiration duration to show trial info only for trial license
merge_request: 4573
author:
type: fixed
......@@ -19,7 +19,7 @@
%span.light #{label}:
%strong= value
.panel.panel-default
.panel.panel-default.js-license-info-panel
.panel-heading
Details
%ul.well-list
......@@ -39,9 +39,11 @@
- else
Expires:
- if @license.will_expire? && @license.active?
%strong= time_ago_with_tooltip(@license.expires_at)
- if @license.trial?
%span Free trial will expire in #{pluralize(@license.remaining_days, 'day')}
%strong.has-tooltip{ title: @license.expires_at.to_formatted_s(:long), data: { placement: 'top' } }
Free trial will expire in #{pluralize(@license.remaining_days, 'day')}
- else
%strong= time_ago_with_tooltip(@license.expires_at)
- else
%strong Never
......
......@@ -27,6 +27,30 @@ feature "License Admin" do
end
end
context 'with a trial license' do
let!(:license) { create(:license, trial: true) }
it 'shows expiration duration with license type' do
visit admin_license_path
page.within '.js-license-info-panel' do
expect(page).to have_content('Expires: Free trial will expire in')
end
end
end
context 'with a regular license' do
let!(:license) { create(:license) }
it 'shows only expiration duration' do
visit admin_license_path
page.within '.js-license-info-panel' do
expect(page).not_to have_content('Expires: Free trial will expire in')
end
end
end
context 'with an expired trial license' do
let!(:license) { create(:license, trial: true, expired: true) }
......
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