Updated

spec/jobs / email_debate_scheduled_job_spec.rb

C
16 lines of codes
0 methods
N/A complexity/method
16 churn
11.9 complexity
53 duplications
require 'rails_helper' require_relative 'shared_examples' RSpec.describe EmailDebateScheduledJob, type: :job do
  1. Similar code found in 3 nodes Locations: 0 1 2
let(:email_requested_at) { Time.current } let(:petition) { FactoryBot.create(:open_petition) } let(:signature) { FactoryBot.create(:validated_signature, :petition => petition) } let(:arguments) { { petition: petition } } before do petition.set_email_requested_at_for('debate_scheduled', to: email_requested_at) allow(petition).to receive_message_chain(:signatures_to_email_for, :find_each).and_yield(signature) end it_behaves_like "job to enqueue signatory mailing jobs" end