mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-22 14:53:15 +00:00
Add spec for AccountableConcern#log_action (#9559)
This commit is contained in:
parent
071eb0e202
commit
dd85700a3e
26
spec/controllers/concerns/accountable_concern_spec.rb
Normal file
26
spec/controllers/concerns/accountable_concern_spec.rb
Normal file
|
@ -0,0 +1,26 @@
|
|||
# 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
|
Loading…
Reference in a new issue