You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
638 B

  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe AccountableConcern do
  4. class Hoge
  5. include AccountableConcern
  6. attr_reader :current_account
  7. def initialize(current_account)
  8. @current_account = current_account
  9. end
  10. end
  11. let(:user) { Fabricate(:user, account: Fabricate(:account)) }
  12. let(:target) { Fabricate(:user, account: Fabricate(:account)) }
  13. let(:hoge) { Hoge.new(user.account) }
  14. describe '#log_action' do
  15. it 'creates Admin::ActionLog' do
  16. expect do
  17. hoge.log_action(:create, target.account)
  18. end.to change { Admin::ActionLog.count }.by(1)
  19. end
  20. end
  21. end