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

23 lines
653 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
2018-11-08 19:23:39 +05:30
expect_next_instance_of(Users::DestroyService) do |service|
expect(service).to receive(:execute).with(user, {})
end
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
2018-11-08 19:23:39 +05:30
expect_next_instance_of(Users::DestroyService) do |service|
expect(service).to receive(:execute).with(user, test: "test")
end
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