diff --git a/spec/features/admin/form_answers/bulk_assessors_assignment_spec.rb b/spec/features/admin/form_answers/bulk_assessors_assignment_spec.rb index 6ac7480d2..0086c93b4 100644 --- a/spec/features/admin/form_answers/bulk_assessors_assignment_spec.rb +++ b/spec/features/admin/form_answers/bulk_assessors_assignment_spec.rb @@ -11,6 +11,7 @@ let(:subject) { create(:admin) } let!(:form_answer_1) { create(:form_answer, :submitted) } let!(:form_answer_2) { create(:form_answer, :submitted) } + let!(:award_year) { AwardYear.current } let!(:settings) { create(:settings, :expired_submission_deadlines) } diff --git a/spec/features/admin/form_answers/bulk_lieutenants_assignment_spec.rb b/spec/features/admin/form_answers/bulk_lieutenants_assignment_spec.rb index 7858cf811..72b4c9b39 100644 --- a/spec/features/admin/form_answers/bulk_lieutenants_assignment_spec.rb +++ b/spec/features/admin/form_answers/bulk_lieutenants_assignment_spec.rb @@ -13,6 +13,7 @@ let!(:ceremonial_county_2) { create(:ceremonial_county, name: "B") } let!(:form_answer_1) { create(:form_answer, :submitted) } let!(:form_answer_2) { create(:form_answer, :submitted) } + let!(:award_year) { AwardYear.current } let!(:settings) { create(:settings, :expired_submission_deadlines) } diff --git a/spec/features/admin/form_answers/eligibility_spec.rb b/spec/features/admin/form_answers/eligibility_spec.rb index 8927d3629..0cd2ce911 100644 --- a/spec/features/admin/form_answers/eligibility_spec.rb +++ b/spec/features/admin/form_answers/eligibility_spec.rb @@ -7,6 +7,7 @@ let!(:form_answer) { create(:form_answer, :submitted) } before do + AwardYear.current Settings.current_submission_deadline.update(trigger_at: 1.day.ago) login_admin(admin) diff --git a/spec/features/admin/form_answers/final_verdict_spec.rb b/spec/features/admin/form_answers/final_verdict_spec.rb index 4462d0ca8..a0f663236 100644 --- a/spec/features/admin/form_answers/final_verdict_spec.rb +++ b/spec/features/admin/form_answers/final_verdict_spec.rb @@ -4,6 +4,7 @@ let(:admin) { create(:admin) } before do + AwardYear.current create(:settings, :expired_submission_deadlines) login_admin(admin) end diff --git a/spec/features/users/eligibility_form_fulfillment_spec.rb b/spec/features/users/eligibility_form_fulfillment_spec.rb index 20d92b30e..50e9aa54f 100644 --- a/spec/features/users/eligibility_form_fulfillment_spec.rb +++ b/spec/features/users/eligibility_form_fulfillment_spec.rb @@ -6,6 +6,7 @@ let!(:user) { create(:user, :completed_profile) } before do + AwardYear.current create(:settings, :submission_deadlines) login_as(user, scope: :user) end diff --git a/spec/models/admin_verdict_spec.rb b/spec/models/admin_verdict_spec.rb index 2968c8b0e..5d1842dee 100644 --- a/spec/models/admin_verdict_spec.rb +++ b/spec/models/admin_verdict_spec.rb @@ -1,6 +1,8 @@ require 'rails_helper' RSpec.describe AdminVerdict, type: :model do + let!(:award_year) { AwardYear.current } + before do create(:settings, :expired_submission_deadlines) end diff --git a/spec/models/sendgrid_helper_spec.rb b/spec/models/sendgrid_helper_spec.rb index cb9c6570a..b1083989b 100644 --- a/spec/models/sendgrid_helper_spec.rb +++ b/spec/models/sendgrid_helper_spec.rb @@ -1,6 +1,18 @@ require 'rails_helper' RSpec.describe SendgridHelper do + before do + # SENDGRID RELATED STUBS - BEGIN + stub_request(:get, "https://sendgrid.com/api/spamreports.get.json?api_key=test_smtp_password&api_user=test_smtp_username&email=test@example.com"). + to_return(status: 200, body: "", headers: {}) + + stub_sendgrid_bounced_emails_check_request("test@irrelevant.com") + stub_sendgrid_bounced_emails_check_request("test@example.com") + # SENDGRID RELATED STUBS - END + + AwardYear.current + end + context 'with sendgrid configured' do around do |example| smtp_settings = Rails.configuration.action_mailer.smtp_settings diff --git a/spec/services/local_assessment_submission_service_spec.rb b/spec/services/local_assessment_submission_service_spec.rb index be82b614d..43eb01cf9 100644 --- a/spec/services/local_assessment_submission_service_spec.rb +++ b/spec/services/local_assessment_submission_service_spec.rb @@ -3,6 +3,7 @@ describe LocalAssessmentSubmissionService do let(:ll) { create(:lieutenant) } let(:nomination) { create(:form_answer, :submitted) } + let!(:award_year) { AwardYear.current } let!(:settings) { create(:settings, :expired_submission_deadlines) } before do diff --git a/spec/support/shared_contexts/appraisal_form_context.rb b/spec/support/shared_contexts/appraisal_form_context.rb index 0bb884816..3697e5adf 100644 --- a/spec/support/shared_contexts/appraisal_form_context.rb +++ b/spec/support/shared_contexts/appraisal_form_context.rb @@ -1,5 +1,6 @@ shared_context "successful appraisal form edition" do let!(:form_answer) { create(:form_answer, :local_assessment_recommended, sub_group: assessor.sub_group) } + let!(:award_year) { AwardYear.current } before do login_as(subject, scope: scope) diff --git a/spec/unit/pdf_generators/qae_pdf_forms/awards2014/qavs/base_spec.rb b/spec/unit/pdf_generators/qae_pdf_forms/awards2014/qavs/base_spec.rb index 66db71364..e8ed09800 100644 --- a/spec/unit/pdf_generators/qae_pdf_forms/awards2014/qavs/base_spec.rb +++ b/spec/unit/pdf_generators/qae_pdf_forms/awards2014/qavs/base_spec.rb @@ -1,6 +1,8 @@ require 'rails_helper' describe "QaePdfForms::Awards2016::Qavs::Base" do + let!(:award_year) { AwardYear.current } + include_context "pdf file checks" let(:step1_question_answers) {