Skip to content

Commit

Permalink
fixing miscelannious spec errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamfall committed Nov 7, 2023
1 parent bc9e565 commit 13dbff5
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) }


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) }


Expand Down
1 change: 1 addition & 0 deletions spec/features/admin/form_answers/eligibility_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions spec/features/admin/form_answers/final_verdict_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
let(:admin) { create(:admin) }

before do
AwardYear.current
create(:settings, :expired_submission_deadlines)
login_admin(admin)
end
Expand Down
1 change: 1 addition & 0 deletions spec/features/users/eligibility_form_fulfillment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
let!(:user) { create(:user, :completed_profile) }

before do
AwardYear.current
create(:settings, :submission_deadlines)
login_as(user, scope: :user)
end
Expand Down
2 changes: 2 additions & 0 deletions spec/models/admin_verdict_spec.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 12 additions & 0 deletions spec/models/sendgrid_helper_spec.rb
Original file line number Diff line number Diff line change
@@ -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 protected]").
to_return(status: 200, body: "", headers: {})

stub_sendgrid_bounced_emails_check_request("[email protected]")
stub_sendgrid_bounced_emails_check_request("[email protected]")
# SENDGRID RELATED STUBS - END

AwardYear.current
end

context 'with sendgrid configured' do
around do |example|
smtp_settings = Rails.configuration.action_mailer.smtp_settings
Expand Down
1 change: 1 addition & 0 deletions spec/services/local_assessment_submission_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions spec/support/shared_contexts/appraisal_form_context.rb
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down

0 comments on commit 13dbff5

Please sign in to comment.