2016-02-17 08:41:33 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe DeleteUserWorker do
|
2016-03-14 06:18:03 -04:00
|
|
|
let!(:user) { create(:user) }
|
|
|
|
let!(:current_user) { create(:user) }
|
2016-02-17 08:41:33 -05:00
|
|
|
|
2016-03-14 06:18:03 -04:00
|
|
|
it "calls the DeleteUserWorker with the params it was given" do
|
|
|
|
expect_any_instance_of(DeleteUserService).to receive(:execute).
|
|
|
|
with(user, {})
|
2016-03-04 03:49:23 -05:00
|
|
|
|
2016-03-14 06:18:03 -04:00
|
|
|
DeleteUserWorker.new.perform(current_user.id, user.id)
|
|
|
|
end
|
2016-03-04 03:49:23 -05:00
|
|
|
|
2016-03-14 06:18:03 -04:00
|
|
|
it "uses symbolized keys" do
|
|
|
|
expect_any_instance_of(DeleteUserService).to receive(:execute).
|
|
|
|
with(user, test: "test")
|
2016-03-04 03:49:23 -05:00
|
|
|
|
2016-03-14 06:18:03 -04:00
|
|
|
DeleteUserWorker.new.perform(current_user.id, user.id, "test" => "test")
|
2016-02-17 08:41:33 -05:00
|
|
|
end
|
|
|
|
end
|