debian-mirror-gitlab/spec/lib/gitlab/subscription_portal_spec.rb

28 lines
1.1 KiB
Ruby
Raw Normal View History

2021-01-03 14:25:43 +05:30
# frozen_string_literal: true
require 'spec_helper'
2021-06-08 01:23:25 +05:30
RSpec.describe ::Gitlab::SubscriptionPortal, skip: Gitlab.jh? do
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
2021-01-03 14:25:43 +05:30
2021-06-08 01:23:25 +05:30
with_them do
subject { described_class.method(method_name).call }
2021-01-03 14:25:43 +05:30
2021-06-08 01:23:25 +05:30
before do
allow(Rails).to receive_message_chain(:env, :test?).and_return(test)
allow(Rails).to receive_message_chain(:env, :development?).and_return(development)
2021-01-03 14:25:43 +05:30
end
2021-06-08 01:23:25 +05:30
it { is_expected.to eq(result) }
2021-01-03 14:25:43 +05:30
end
end