diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-20 16:37:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-20 16:37:47 +0300 |
commit | aee0a117a889461ce8ced6fcf73207fe017f1d99 (patch) | |
tree | 891d9ef189227a8445d83f35c1b0fc99573f4380 /spec/services/concerns | |
parent | 8d46af3258650d305f53b819eabf7ab18d22f59e (diff) |
Add latest changes from gitlab-org/gitlab@14-6-stable-eev14.6.0-rc42
Diffstat (limited to 'spec/services/concerns')
-rw-r--r-- | spec/services/concerns/audit_event_save_type_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/services/concerns/audit_event_save_type_spec.rb b/spec/services/concerns/audit_event_save_type_spec.rb new file mode 100644 index 00000000000..fbaebd9f85c --- /dev/null +++ b/spec/services/concerns/audit_event_save_type_spec.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe AuditEventSaveType do + subject(:target) { Object.new.extend(described_class) } + + describe '#should_save_database? and #should_save_stream?' do + using RSpec::Parameterized::TableSyntax + + where(:query_method, :query_param, :result) do + :should_save_stream? | :stream | true + :should_save_stream? | :database_and_stream | true + :should_save_database? | :database | true + :should_save_database? | :database_and_stream | true + :should_save_stream? | :database | false + :should_save_stream? | nil | false + :should_save_database? | :stream | false + :should_save_database? | nil | false + end + + with_them do + it 'returns corresponding results according to the query_method and query_param' do + expect(target.send(query_method, query_param)).to eq result + end + end + end +end |