Follow up: Applied required rubocop changes to newly introduced specs.

This commit is contained in:
Thorsten Eckel 2020-02-20 14:56:52 +01:00
parent 22911f8616
commit 082cbed915
4 changed files with 11 additions and 3 deletions

View file

@ -105,6 +105,7 @@ RSpec.describe HasTicketCreateScreenImpact, type: :job do
end
expect(collection_jobs.count).to be(0)
end
it 'agent should enqueue a job' do
agent_new
collection_jobs = enqueued_jobs.select do |job|
@ -112,6 +113,7 @@ RSpec.describe HasTicketCreateScreenImpact, type: :job do
end
expect(collection_jobs.count).to be(1)
end
it 'admin should enqueue no job' do
admin_new
collection_jobs = enqueued_jobs.select do |job|
@ -130,9 +132,11 @@ RSpec.describe HasTicketCreateScreenImpact, type: :job do
it 'customer should enqueue no job' do
expect { customer.update!(firstname: 'new firstname') }.not_to have_enqueued_job(TicketCreateScreenJob)
end
it 'agent should enqueue a job' do
expect { agent.update!(firstname: 'new firstname') }.to have_enqueued_job(TicketCreateScreenJob)
end
it 'admin should enqueue no job' do
expect { admin.update!(firstname: 'new firstname') }.not_to have_enqueued_job(TicketCreateScreenJob)
end
@ -142,9 +146,11 @@ RSpec.describe HasTicketCreateScreenImpact, type: :job do
it 'customer should enqueue no job' do
expect { customer.update!(active: false) }.not_to have_enqueued_job(TicketCreateScreenJob)
end
it 'agent should enqueue a job' do
expect { agent.update!(active: false) }.to have_enqueued_job(TicketCreateScreenJob)
end
it 'admin should enqueue no job' do
admin_new # Prevend "Minimum one user needs to have admin permissions."
clear_jobs
@ -161,9 +167,11 @@ RSpec.describe HasTicketCreateScreenImpact, type: :job do
it 'customer should enqueue a job' do
expect { customer.destroy! }.to have_enqueued_job(TicketCreateScreenJob)
end
it 'agent should enqueue a job' do
expect { agent.destroy! }.to have_enqueued_job(TicketCreateScreenJob)
end
it 'admin should enqueue a job' do
expect { admin.destroy! }.to have_enqueued_job(TicketCreateScreenJob)
end

View file

@ -1,6 +1,6 @@
RSpec.shared_examples 'HasCollectionUpdate' do |collection_factory:|
context '#push_collection_to_clients', performs_jobs: true do
describe '#push_collection_to_clients', performs_jobs: true do
subject { create(collection_factory) }
context 'creating a record' do

View file

@ -1,6 +1,6 @@
RSpec.shared_examples 'HasTicketCreateScreenImpact' do |create_screen_factory:|
context '#push_ticket_create_screen', performs_jobs: true do
describe '#push_ticket_create_screen', performs_jobs: true do
subject { create(create_screen_factory) }
context 'creating a record' do

View file

@ -1,6 +1,6 @@
RSpec.shared_examples 'HasTicketCreateScreenImpact' do
context '#push_ticket_create_screen', performs_jobs: true do
describe '#push_ticket_create_screen', performs_jobs: true do
shared_examples 'relevant User Role' do |role|
context "relevant User Role is '#{role}'" do