Commit 0ce66da0 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch '31364-error-when-attempting-to-view-gitlab-com-group-billing-page' into 'master'

Resolve "Error 502 when viewing  billing page after trial ends"

See merge request gitlab-org/gitlab!18740
parents 42a4a6f8 375589ea
---
title: Fix error when viewing group billing page
merge_request: 18740
author:
type: fixed
- faq_link = link_to s_("BillingPlans|frequently asked questions"), "https://about.gitlab.com/gitlab-com/#faq"
- pricing_page_link = link_to s_("BillingPlans|Pricing page"), "https://about.gitlab.com/pricing"
- features_link = link_to s_("BillingPlans|features"), "https://about.gitlab.com/features"
- learn_more_text = s_("BillingPlans|Learn more about each plan by reading our %{faq_link}.").html_safe % { faq_link: faq_link }
- 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 }
......
# frozen_string_literal: true
require 'spec_helper'
describe 'shared/billings/_trial_status.html.haml' do
include ApplicationHelper
let(:group) { create(:group) }
let(:gitlab_subscription) { create(:gitlab_subscription, namespace: group) }
let(:plan) { nil }
let(:trial_ends_on) { nil }
let(:trial) { false }
before do
gitlab_subscription.update(
hosted_plan: plan,
trial_ends_on: trial_ends_on,
trial: trial
)
end
context 'when not eligible for trial' do
it 'offers to learn more about plans' do
render 'shared/billings/trial_status', namespace: group
expect(rendered).to have_content("Learn more about each plan by visiting our")
end
end
context 'when trial active' do
let(:plan) { create(:bronze_plan) }
let(:trial_ends_on) { Date.tomorrow }
let(:trial) { true }
it 'displays expiry date' do
render 'shared/billings/trial_status', namespace: group
expect(rendered).to have_content("Your GitLab.com trial will expire after #{trial_ends_on}")
end
end
context 'when trial expired' do
let(:plan) { create(:free_plan) }
let(:trial_ends_on) { Date.yesterday }
it 'displays the date is expired' do
render 'shared/billings/trial_status', namespace: group
expect(rendered).to have_content("Your GitLab.com trial expired on #{trial_ends_on}")
end
end
context 'when eligible for trial' do
before do
allow(::Gitlab).to receive(:com?).and_return(true)
end
it 'offers a trial' do
render 'shared/billings/trial_status', namespace: group
expect(rendered).to have_content("start a free 30-day trial of GitLab.com Gold")
end
end
end
......@@ -2415,6 +2415,9 @@ msgstr ""
msgid "BillingPlans|Learn more about each plan by reading our %{faq_link}, or start a free 30-day trial of GitLab.com Gold."
msgstr ""
msgid "BillingPlans|Learn more about each plan by reading our %{faq_link}."
msgstr ""
msgid "BillingPlans|Learn more about each plan by visiting our %{pricing_page_link}."
msgstr ""
......
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