summaryrefslogtreecommitdiff
path: root/spec/workers/delete_user_worker_spec.rb
blob: 5912dd76262fbd9d954763d3068cd5c182214fc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'spec_helper'

describe DeleteUserWorker do
  let!(:user)         { create(:user) }
  let!(:current_user) { create(:user) }

  it "calls the DeleteUserWorker with the params it was given" do
    expect_any_instance_of(Users::DestroyService).to receive(:execute).
                                                      with(user, {})

    described_class.new.perform(current_user.id, user.id)
  end

  it "uses symbolized keys" do
    expect_any_instance_of(Users::DestroyService).to receive(:execute).
                                                      with(user, test: "test")

    described_class.new.perform(current_user.id, user.id, "test" => "test")
  end
end