We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0953f5c commit ed74d3dCopy full SHA for ed74d3d
1 file changed
spec/controllers/concerns/accountable_concern_spec.rb
@@ -0,0 +1,26 @@
1
+# frozen_string_literal: true
2
+
3
+require 'rails_helper'
4
5
+RSpec.describe AccountableConcern do
6
+ class Hoge
7
+ include AccountableConcern
8
+ attr_reader :current_account
9
10
+ def initialize(current_account)
11
+ @current_account = current_account
12
+ end
13
14
15
+ let(:user) { Fabricate(:user, account: Fabricate(:account)) }
16
+ let(:target) { Fabricate(:user, account: Fabricate(:account)) }
17
+ let(:hoge) { Hoge.new(user.account) }
18
19
+ describe '#log_action' do
20
+ it 'creates Admin::ActionLog' do
21
+ expect do
22
+ hoge.log_action(:create, target.account)
23
+ end.to change { Admin::ActionLog.count }.by(1)
24
25
26
+end
0 commit comments