Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-05-19 18:44:42 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-19 18:44:42 +0300
commit4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch)
tree5423a1c7516cffe36384133ade12572cf709398d /spec/lib/gitlab/subscription_portal_spec.rb
parente570267f2f6b326480d284e0164a6464ba4081bc (diff)
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'spec/lib/gitlab/subscription_portal_spec.rb')
-rw-r--r--spec/lib/gitlab/subscription_portal_spec.rb53
1 files changed, 18 insertions, 35 deletions
diff --git a/spec/lib/gitlab/subscription_portal_spec.rb b/spec/lib/gitlab/subscription_portal_spec.rb
index ad1affdac0b..ed551521b1d 100644
--- a/spec/lib/gitlab/subscription_portal_spec.rb
+++ b/spec/lib/gitlab/subscription_portal_spec.rb
@@ -2,43 +2,26 @@
require 'spec_helper'
-RSpec.describe ::Gitlab::SubscriptionPortal do
- unless Gitlab.jh?
- describe '.default_subscriptions_url' do
- subject { described_class.default_subscriptions_url }
-
- context 'on non test and non dev environments' do
- before do
- allow(Rails).to receive_message_chain(:env, :test?).and_return(false)
- allow(Rails).to receive_message_chain(:env, :development?).and_return(false)
- end
-
- it 'returns production subscriptions app URL' do
- is_expected.to eq('https://customers.gitlab.com')
- end
- end
-
- context 'on dev environment' do
- before do
- allow(Rails).to receive_message_chain(:env, :test?).and_return(false)
- allow(Rails).to receive_message_chain(:env, :development?).and_return(true)
- end
-
- it 'returns staging subscriptions app url' do
- is_expected.to eq('https://customers.stg.gitlab.com')
- end
- end
+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
- context 'on test environment' do
- before do
- allow(Rails).to receive_message_chain(:env, :test?).and_return(true)
- allow(Rails).to receive_message_chain(:env, :development?).and_return(false)
- end
+ with_them do
+ subject { described_class.method(method_name).call }
- it 'returns staging subscriptions app url' do
- is_expected.to eq('https://customers.stg.gitlab.com')
- end
- end
+ before do
+ allow(Rails).to receive_message_chain(:env, :test?).and_return(test)
+ allow(Rails).to receive_message_chain(:env, :development?).and_return(development)
end
+
+ it { is_expected.to eq(result) }
end
end