debian-mirror-gitlab/spec/workers/delete_user_worker_spec.rb

21 lines
675 B
Ruby
Raw Normal View History

2016-06-02 11:05:42 +05:30
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
2017-09-10 17:25:29 +05:30
expect_any_instance_of(Users::DestroyService).to receive(:execute)
.with(user, {})
2016-06-02 11:05:42 +05:30
2017-08-17 22:00:37 +05:30
described_class.new.perform(current_user.id, user.id)
2016-06-02 11:05:42 +05:30
end
it "uses symbolized keys" do
2017-09-10 17:25:29 +05:30
expect_any_instance_of(Users::DestroyService).to receive(:execute)
.with(user, test: "test")
2016-06-02 11:05:42 +05:30
2017-08-17 22:00:37 +05:30
described_class.new.perform(current_user.id, user.id, "test" => "test")
2016-06-02 11:05:42 +05:30
end
end