summaryrefslogtreecommitdiff
path: root/spec/services/users/dismiss_user_callout_service_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/users/dismiss_user_callout_service_spec.rb')
-rw-r--r--spec/services/users/dismiss_user_callout_service_spec.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/services/users/dismiss_user_callout_service_spec.rb b/spec/services/users/dismiss_user_callout_service_spec.rb
new file mode 100644
index 00000000000..22f84a939f7
--- /dev/null
+++ b/spec/services/users/dismiss_user_callout_service_spec.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Users::DismissUserCalloutService do
+ let(:user) { create(:user) }
+
+ let(:service) do
+ described_class.new(
+ container: nil, current_user: user, params: { feature_name: UserCallout.feature_names.each_key.first }
+ )
+ end
+
+ describe '#execute' do
+ subject(:execute) { service.execute }
+
+ it 'returns a user callout' do
+ expect(execute).to be_an_instance_of(UserCallout)
+ end
+
+ it 'sets the dismisse_at attribute to current time' do
+ freeze_time do
+ expect(execute).to have_attributes(dismissed_at: Time.current)
+ end
+ end
+ end
+end