blob: 87690e7debca64879976b273bfc0b9d2094430bd (
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
40
41
42
43
44
45
46
47
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Groups::CrmSettingsHelper do
let_it_be(:root_group) { create(:group) }
describe '#crm_feature_available?' do
subject do
helper.crm_feature_available?(group)
end
context 'in root group' do
let(:group) { root_group }
context 'when feature flag is enabled' do
it { is_expected.to be_truthy }
end
context 'when feature flag is disabled' do
before do
stub_feature_flags(customer_relations: false)
end
it { is_expected.to be_falsy }
end
end
context 'in subgroup' do
let_it_be(:subgroup) { create(:group, parent: root_group) }
let(:group) { subgroup }
context 'when feature flag is enabled' do
it { is_expected.to be_truthy }
end
context 'when feature flag is disabled' do
before do
stub_feature_flags(customer_relations: false)
end
it { is_expected.to be_falsy }
end
end
end
end
|