blob: 96d3e855843f7c6f635392f12ac6fd5d7f213a3d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe ::Gitlab::SubscriptionPortal do
using RSpec::Parameterized::TableSyntax
include SubscriptionPortalHelper
let(:env_value) { nil }
before do
stub_env('CUSTOMER_PORTAL_URL', env_value)
end
describe 'class methods' do
where(:method_name, :result) do
:payment_validation_form_id | 'payment_method_validation'
:registration_validation_form_id | 'cc_registration_validation'
end
with_them do
subject { described_class.send(method_name) }
it { is_expected.to eq(result) }
end
end
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
end
|