Skip to content
Snippets Groups Projects
Commit dd85700a authored by ysksn's avatar ysksn Committed by Eugen Rochko
Browse files

Add spec for AccountableConcern#log_action (#9559)

parent 071eb0e2
No related branches found
No related tags found
No related merge requests found
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe AccountableConcern do
class Hoge
include AccountableConcern
attr_reader :current_account
def initialize(current_account)
@current_account = current_account
end
end
let(:user) { Fabricate(:user, account: Fabricate(:account)) }
let(:target) { Fabricate(:user, account: Fabricate(:account)) }
let(:hoge) { Hoge.new(user.account) }
describe '#log_action' do
it 'creates Admin::ActionLog' do
expect do
hoge.log_action(:create, target.account)
end.to change { Admin::ActionLog.count }.by(1)
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment