This repository has been archived on 2024-06-09. You can view files and clone it, but cannot push or open issues/pull-requests.
2018-12-18 16:43:03 +01:00
|
|
|
# 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
|
|
|
|
|
2022-01-28 00:46:42 +01:00
|
|
|
let(:user) { Fabricate(:account) }
|
|
|
|
let(:target) { Fabricate(:account) }
|
|
|
|
let(:hoge) { Hoge.new(user) }
|
2018-12-18 16:43:03 +01:00
|
|
|
|
|
|
|
describe '#log_action' do
|
|
|
|
it 'creates Admin::ActionLog' do
|
|
|
|
expect do
|
2022-01-28 00:46:42 +01:00
|
|
|
hoge.log_action(:create, target)
|
2018-12-18 16:43:03 +01:00
|
|
|
end.to change { Admin::ActionLog.count }.by(1)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|