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