Commit 4f2c6ae0 authored by Alper Akgun's avatar Alper Akgun Committed by Jan Provaznik

Gitlab.com trial status copy shows plan

On Gitlab.com For active trials in billing page. Instead of showing
"Gold" - this change shows "Silver" or "Bronze" depending on the
active trial type.
parent 83266cf9
---
title: SaaS trial copy shows plan
merge_request: 20207
author:
type: changed
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
- if namespace.eligible_for_trial? - if namespace.eligible_for_trial?
= s_("BillingPlans|Learn more about each plan by reading our %{faq_link}, or start a free 30-day trial of GitLab.com Gold.").html_safe % { faq_link: faq_link } = s_("BillingPlans|Learn more about each plan by reading our %{faq_link}, or start a free 30-day trial of GitLab.com Gold.").html_safe % { faq_link: faq_link }
- elsif namespace.trial_active? - elsif namespace.trial_active?
= s_("BillingPlans|Your GitLab.com Gold trial will <strong>expire after %{expiration_date}</strong>. You can retain access to the Gold features by upgrading below.").html_safe % { expiration_date: namespace.trial_ends_on } = s_("BillingPlans|Your GitLab.com %{plan} trial will <strong>expire after %{expiration_date}</strong>. You can retain access to the %{plan} features by upgrading below.").html_safe % { plan: namespace.plan&.title, expiration_date: namespace.trial_ends_on }
- elsif namespace.trial_expired? - elsif namespace.trial_expired?
= s_("BillingPlans|Your GitLab.com Gold trial expired on %{expiration_date}. You can restore access to the Gold features at any time by upgrading below.").html_safe % { expiration_date: namespace.trial_ends_on } = s_("BillingPlans|Your GitLab.com trial expired on %{expiration_date}. You can restore access to the features at any time by upgrading below.").html_safe % { expiration_date: namespace.trial_ends_on }
- else - else
= s_("BillingPlans|Learn more about each plan by visiting our %{pricing_page_link}.").html_safe % { pricing_page_link: pricing_page_link } = s_("BillingPlans|Learn more about each plan by visiting our %{pricing_page_link}.").html_safe % { pricing_page_link: pricing_page_link }
...@@ -5,8 +5,8 @@ require 'spec_helper' ...@@ -5,8 +5,8 @@ require 'spec_helper'
describe 'shared/billings/_trial_status.html.haml' do describe 'shared/billings/_trial_status.html.haml' do
include ApplicationHelper include ApplicationHelper
let(:group) { create(:group) } let_it_be(:group) { create(:group) }
let(:gitlab_subscription) { create(:gitlab_subscription, namespace: group) } let_it_be(:gitlab_subscription) { create(:gitlab_subscription, namespace: group) }
let(:plan) { nil } let(:plan) { nil }
let(:trial_ends_on) { nil } let(:trial_ends_on) { nil }
let(:trial) { false } let(:trial) { false }
...@@ -17,6 +17,7 @@ describe 'shared/billings/_trial_status.html.haml' do ...@@ -17,6 +17,7 @@ describe 'shared/billings/_trial_status.html.haml' do
trial_ends_on: trial_ends_on, trial_ends_on: trial_ends_on,
trial: trial trial: trial
) )
group.update(plan: plan)
end end
context 'when not eligible for trial' do context 'when not eligible for trial' do
...@@ -27,13 +28,27 @@ describe 'shared/billings/_trial_status.html.haml' do ...@@ -27,13 +28,27 @@ describe 'shared/billings/_trial_status.html.haml' do
end end
context 'when trial active' do context 'when trial active' do
let(:plan) { create(:bronze_plan) }
let(:trial_ends_on) { Date.tomorrow } let(:trial_ends_on) { Date.tomorrow }
let(:trial) { true } let(:trial) { true }
it 'displays expiry date' do context 'with a gold trial' do
render 'shared/billings/trial_status', namespace: group let(:plan) { create(:gold_plan, title: 'Gold') }
expect(rendered).to have_content("Your GitLab.com Gold trial will expire after #{trial_ends_on}")
it 'displays expiry date and Gold' do
render 'shared/billings/trial_status', namespace: group
expect(rendered).to have_content("Your GitLab.com Gold trial will expire after #{trial_ends_on}. You can retain access to the Gold features by upgrading below.")
end
end
context 'with a silver trial' do
let(:plan) { create(:gold_plan, title: 'Silver') }
it 'displays expiry date and Silver' do
render 'shared/billings/trial_status', namespace: group
expect(rendered).to have_content("Your GitLab.com Silver trial will expire after #{trial_ends_on}. You can retain access to the Silver features by upgrading below.")
end
end end
end end
...@@ -43,7 +58,8 @@ describe 'shared/billings/_trial_status.html.haml' do ...@@ -43,7 +58,8 @@ describe 'shared/billings/_trial_status.html.haml' do
it 'displays the date is expired' do it 'displays the date is expired' do
render 'shared/billings/trial_status', namespace: group render 'shared/billings/trial_status', namespace: group
expect(rendered).to have_content("Your GitLab.com Gold trial expired on #{trial_ends_on}")
expect(rendered).to have_content("Your GitLab.com trial expired on #{trial_ends_on}")
end end
end end
...@@ -54,6 +70,7 @@ describe 'shared/billings/_trial_status.html.haml' do ...@@ -54,6 +70,7 @@ describe 'shared/billings/_trial_status.html.haml' do
it 'offers a trial' do it 'offers a trial' do
render 'shared/billings/trial_status', namespace: group render 'shared/billings/trial_status', namespace: group
expect(rendered).to have_content("start a free 30-day trial of GitLab.com Gold") expect(rendered).to have_content("start a free 30-day trial of GitLab.com Gold")
end end
end end
......
...@@ -2515,10 +2515,10 @@ msgstr "" ...@@ -2515,10 +2515,10 @@ msgstr ""
msgid "BillingPlans|To manage the plan for this group, visit the billing section of %{parent_billing_page_link}." msgid "BillingPlans|To manage the plan for this group, visit the billing section of %{parent_billing_page_link}."
msgstr "" msgstr ""
msgid "BillingPlans|Your GitLab.com Gold trial expired on %{expiration_date}. You can restore access to the Gold features at any time by upgrading below." msgid "BillingPlans|Your GitLab.com %{plan} trial will <strong>expire after %{expiration_date}</strong>. You can retain access to the %{plan} features by upgrading below."
msgstr "" msgstr ""
msgid "BillingPlans|Your GitLab.com Gold trial will <strong>expire after %{expiration_date}</strong>. You can retain access to the Gold features by upgrading below." msgid "BillingPlans|Your GitLab.com trial expired on %{expiration_date}. You can restore access to the features at any time by upgrading below."
msgstr "" msgstr ""
msgid "BillingPlans|billed annually at %{price_per_year}" msgid "BillingPlans|billed annually at %{price_per_year}"
......
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