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

45 lines
1.4 KiB
Ruby
Raw Normal View History

2021-01-03 14:25:43 +05:30
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe ::Gitlab::SubscriptionPortal do
2021-04-29 21:17:54 +05:30
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
2021-01-03 14:25:43 +05:30
end
2021-04-29 21:17:54 +05:30
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
2021-01-03 14:25:43 +05:30
2021-04-29 21:17:54 +05:30
it 'returns staging subscriptions app url' do
is_expected.to eq('https://customers.stg.gitlab.com')
end
2021-01-03 14:25:43 +05:30
end
2021-04-29 21:17:54 +05:30
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
2021-01-03 14:25:43 +05:30
2021-04-29 21:17:54 +05:30
it 'returns staging subscriptions app url' do
is_expected.to eq('https://customers.stg.gitlab.com')
end
2021-01-03 14:25:43 +05:30
end
end
end
end