2020-10-13 02:09:09 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2021-07-26 08:10:08 -04:00
|
|
|
RSpec.describe ::Gitlab::SubscriptionPortal do
|
2021-05-18 11:10:46 -04:00
|
|
|
using RSpec::Parameterized::TableSyntax
|
|
|
|
|
|
|
|
where(:method_name, :test, :development, :result) do
|
|
|
|
:default_subscriptions_url | false | false | 'https://customers.gitlab.com'
|
|
|
|
:default_subscriptions_url | false | true | 'https://customers.stg.gitlab.com'
|
|
|
|
:default_subscriptions_url | true | false | 'https://customers.stg.gitlab.com'
|
|
|
|
:payment_form_url | false | false | 'https://customers.gitlab.com/payment_forms/cc_validation'
|
|
|
|
:payment_form_url | false | true | 'https://customers.stg.gitlab.com/payment_forms/cc_validation'
|
|
|
|
:payment_form_url | true | false | 'https://customers.stg.gitlab.com/payment_forms/cc_validation'
|
|
|
|
end
|
2020-10-13 02:09:09 -04:00
|
|
|
|
2021-05-18 11:10:46 -04:00
|
|
|
with_them do
|
|
|
|
subject { described_class.method(method_name).call }
|
2020-10-13 02:09:09 -04:00
|
|
|
|
2021-05-18 11:10:46 -04:00
|
|
|
before do
|
|
|
|
allow(Rails).to receive_message_chain(:env, :test?).and_return(test)
|
|
|
|
allow(Rails).to receive_message_chain(:env, :development?).and_return(development)
|
2020-10-13 02:09:09 -04:00
|
|
|
end
|
2021-05-07 08:10:27 -04:00
|
|
|
|
2021-05-18 11:10:46 -04:00
|
|
|
it { is_expected.to eq(result) }
|
2020-10-13 02:09:09 -04:00
|
|
|
end
|
|
|
|
end
|