~cytrogen/masto-fe

ref: 3a679844e499df026be7d5b3a9e80e5bf3ad585a masto-fe/spec/controllers/concerns/accountable_concern_spec.rb -rw-r--r-- 617 bytes
3a679844 — Eugen Rochko Fix `account_id`, `max_id` and `min_id` params not working in search (#26847) 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe AccountableConcern do
  let(:hoge_class) do
    Class.new do
      include AccountableConcern
      attr_reader :current_account

      def initialize(current_account)
        @current_account = current_account
      end
    end
  end

  let(:user)   { Fabricate(:account) }
  let(:target) { Fabricate(:account) }
  let(:hoge)   { hoge_class.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