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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
893 B
Ruby
Raw Permalink Normal View History

2021-01-03 14:25:43 +05:30
# frozen_string_literal: true
require 'spec_helper'
2021-10-27 15:23:28 +05:30
RSpec.describe ::Gitlab::SubscriptionPortal do
2021-06-08 01:23:25 +05:30
using RSpec::Parameterized::TableSyntax
2022-07-23 23:45:48 +05:30
include SubscriptionPortalHelper
2021-06-08 01:23:25 +05:30
2021-11-18 22:05:49 +05:30
let(:env_value) { nil }
before do
stub_env('CUSTOMER_PORTAL_URL', env_value)
2021-06-08 01:23:25 +05:30
end
2021-01-03 14:25:43 +05:30
2022-10-11 01:57:18 +05:30
describe 'class methods' do
2021-11-18 22:05:49 +05:30
where(:method_name, :result) do
2022-07-23 23:45:48 +05:30
:payment_validation_form_id | 'payment_method_validation'
2022-10-11 01:57:18 +05:30
:registration_validation_form_id | 'cc_registration_validation'
2021-11-18 22:05:49 +05:30
end
with_them do
subject { described_class.send(method_name) }
it { is_expected.to eq(result) }
end
end
2022-10-11 01:57:18 +05:30
describe 'constants' do
where(:constant_name, :result) do
'REGISTRATION_VALIDATION_FORM_ID' | 'cc_registration_validation'
end
with_them do
subject { "#{described_class}::#{constant_name}".constantize }
it { is_expected.to eq(result) }
end
end
2021-01-03 14:25:43 +05:30
end