Updated

spec/jobs / update_petition_statistics_job_spec.rb

A
14 lines of codes
0 methods
N/A complexity/method
1 churn
33.57 complexity
0 duplications
require 'rails_helper' RSpec.describe UpdatePetitionStatisticsJob, type: :job do let(:petition) { FactoryBot.create(:open_petition) } let(:statistics) { petition.statistics } it "updates the petition statistics" do
  1. it#updates the petition statistics has a flog score of 27
expect { described_class.perform_now(petition) }.to change { statistics.reload.refreshed_at }.to(be_within(1.second).of(Time.current)) end end