1
0
mirror of https://github.com/mastodon/mastodon synced 2024-12-26 04:28:15 +09:00
mastodon/spec/controllers/concerns/accountable_concern_spec.rb

27 lines
568 B
Ruby
Raw Normal View History

# 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(:account) }
let(:target) { Fabricate(:account) }
let(:hoge) { Hoge.new(user) }
describe '#log_action' do
it 'creates Admin::ActionLog' do
expect do
hoge.log_action(:create, target)
end.to change { Admin::ActionLog.count }.by(1)
end
end
end