summaryrefslogtreecommitdiff
path: root/spec/services/feature_flags/create_service_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/feature_flags/create_service_spec.rb')
-rw-r--r--spec/services/feature_flags/create_service_spec.rb16
1 files changed, 6 insertions, 10 deletions
diff --git a/spec/services/feature_flags/create_service_spec.rb b/spec/services/feature_flags/create_service_spec.rb
index 4eb2b25fb64..5a517ce6a64 100644
--- a/spec/services/feature_flags/create_service_spec.rb
+++ b/spec/services/feature_flags/create_service_spec.rb
@@ -48,8 +48,9 @@ RSpec.describe FeatureFlags::CreateService do
{
name: 'feature_flag',
description: 'description',
- scopes_attributes: [{ environment_scope: '*', active: true },
- { environment_scope: 'production', active: false }]
+ version: 'new_version_flag',
+ strategies_attributes: [{ name: 'default', scopes_attributes: [{ environment_scope: '*' }], parameters: {} },
+ { name: 'default', parameters: {}, scopes_attributes: [{ environment_scope: 'production' }] }]
}
end
@@ -68,15 +69,10 @@ RSpec.describe FeatureFlags::CreateService do
end
it 'creates audit event' do
- expected_message = 'Created feature flag feature_flag '\
- 'with description "description". '\
- 'Created rule * and set it as active '\
- 'with strategies [{"name"=>"default", "parameters"=>{}}]. '\
- 'Created rule production and set it as inactive '\
- 'with strategies [{"name"=>"default", "parameters"=>{}}].'
-
expect { subject }.to change { AuditEvent.count }.by(1)
- expect(AuditEvent.last.details[:custom_message]).to eq(expected_message)
+ expect(AuditEvent.last.details[:custom_message]).to start_with('Created feature flag feature_flag with description "description".')
+ expect(AuditEvent.last.details[:custom_message]).to include('Created strategy "default" with scopes "*".')
+ expect(AuditEvent.last.details[:custom_message]).to include('Created strategy "default" with scopes "production".')
end
context 'when user is reporter' do