gitlab-org--gitlab-foss/spec/workers/delete_user_worker_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
698 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require 'spec_helper'
RSpec.describe DeleteUserWorker do
2016-03-14 06:18:03 -04:00
let!(:user) { create(:user) }
let!(:current_user) { create(:user) }
2016-03-14 06:18:03 -04:00
it "calls the DeleteUserWorker with the params it was given" do
expect_next_instance_of(Users::DestroyService) do |service|
expect(service).to receive(:execute).with(user, {})
end
2016-03-04 03:49:23 -05:00
described_class.new.perform(current_user.id, user.id)
2016-03-14 06:18:03 -04:00
end
2016-03-04 03:49:23 -05:00
2016-03-14 06:18:03 -04:00
it "uses symbolized keys" do
expect_next_instance_of(Users::DestroyService) do |service|
expect(service).to receive(:execute).with(user, { test: "test" })
end
2016-03-04 03:49:23 -05:00
described_class.new.perform(current_user.id, user.id, { "test" => "test" })
end
end