BigW Consortium Gitlab

delete_user_worker_spec.rb 669 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 8 9
  it "calls the DeleteUserWorker with the params it was given" do
    expect_any_instance_of(DeleteUserService).to receive(:execute).
                                                      with(user, {})
10

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

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

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