Commit bdeebb00 authored by Ruben Davila's avatar Ruben Davila

Fix some broken specs plus small refactors.

parent 1f7aefb1
......@@ -10,11 +10,9 @@ class Admin::TrialsController < Admin::ApplicationController
if save_license
redirect_to admin_license_url, notice: 'Your trial license was successfully activated'
else
message = <<~MSG
An error occurred while generating the trial license, please try again a few minutes.<br>
If the error persist please try by creating the license from
<a href="https://about.gitlab.com/free-trial/" target="_blank">this page</a>.
MSG
message = 'An error occurred while generating the trial license, please try again a few minutes.<br>'\
'If the error persist please try by creating the license from '\
'<a href="https://about.gitlab.com/free-trial/" target="_blank">this page</a>.'
flash.now[:alert] = message.html_safe
render :new
......@@ -41,7 +39,7 @@ class Admin::TrialsController < Admin::ApplicationController
def check_presence_of_license
if error_message.present?
redirect_to admin_license_url, alert: error_message.html_safe
redirect_to admin_license_url, alert: error_message
end
end
......@@ -49,10 +47,8 @@ class Admin::TrialsController < Admin::ApplicationController
def error_message
@message ||= if License.trial.present?
<<~MSG
You have already used a free trial, if you want to extend it please contact us at
<a href="mailto:sales@gitlab.com">sales@gitlab.com</a>
MSG
'You have already used a free trial, if you want to extend it please contact us at '\
'<a href="mailto:sales@gitlab.com">sales@gitlab.com</a>.'.html_safe
elsif License.current&.active?
'You already have an active license key installed on this server.'
end
......
......@@ -10,7 +10,7 @@
= render "blank_state_admin_welcome"
- else
= render "blank_state_welcome"
- if !current_license&.trial? && current_user.admin?
- if !current_license && current_user.admin?
.col-md-6.section-container
.container.section-body.section-ee-trial
= render "blank_state_ee_trial"
- if current_user&.admin? && license_message.present?
- if current_license&.trial? && license_message.present?
.alert.alert-dismissible.gitlab-ee-trial-banner.hidden.js-gitlab-ee-trial-banner{ role: 'alert', 'data-license-expiry' => current_license.expires_at }
%button.close{ type: 'button', 'data-dismiss' => 'alert', 'aria-label' => 'Dismiss banner' }
= icon('times', 'aria-hidden' => 'true')
......
= render "layouts/header/ee_trial_banner"
%header.navbar.navbar-gitlab.navbar-gitlab-new.js-navbar-gitlab{ class: nav_header_class }
%a.sr-only.gl-accessibility{ href: "#content-body", tabindex: "1" } Skip to content
.container-fluid
......
......@@ -301,7 +301,7 @@ describe License do
let!(:license) { create(:license, trial: true) }
it 'returns false' do
expect(described_class.block_changes?).to eq(false)
expect(described_class.block_changes?).to be_falsey
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