BigW Consortium Gitlab

delete_user_worker_spec.rb 675 Bytes
Newer Older
1 2 3
require 'spec_helper'

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

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

11
    described_class.new.perform(current_user.id, user.id)
12
  end
13

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

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