cartodb-4.42/spec/models/carto/feature_flag_spec.rb

32 lines
884 B
Ruby
Raw Normal View History

2024-04-06 13:25:13 +08:00
require_relative '../../spec_helper_min'
describe Carto::FeatureFlag do
let(:restricted_feature_flag) { create(:feature_flag, :restricted) }
let(:not_restricted_feature_flag) { create(:feature_flag, :not_restricted) }
describe '::restricted' do
subject { Carto::FeatureFlag.restricted }
it 'returns restricted feature flags' do
expect(subject).to include(restricted_feature_flag)
end
it 'does not return unrestricted feature flags' do
expect(subject).not_to include(not_restricted_feature_flag)
end
end
describe '::not_restricted' do
subject { Carto::FeatureFlag.not_restricted }
it 'does not return restricted feature flags' do
expect(subject).not_to include(restricted_feature_flag)
end
it 'returns unrestricted feature flags' do
expect(subject).to include(not_restricted_feature_flag)
end
end
end