2020-10-13 06:09:09 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2021-07-26 12:10:08 +00:00
|
|
|
RSpec.describe ::Gitlab::SubscriptionPortal do
|
2021-05-18 15:10:46 +00: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 06:09:09 +00:00
|
|
|
|
2021-05-18 15:10:46 +00:00
|
|
|
with_them do
|
|
|
|
subject { described_class.method(method_name).call }
|
2020-10-13 06:09:09 +00:00
|
|
|
|
2021-05-18 15:10:46 +00: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 06:09:09 +00:00
|
|
|
end
|
2021-05-07 12:10:27 +00:00
|
|
|
|
2021-05-18 15:10:46 +00:00
|
|
|
it { is_expected.to eq(result) }
|
2020-10-13 06:09:09 +00:00
|
|
|
end
|
|
|
|
end
|