Skip to content
This repository has been archived by the owner on Nov 6, 2021. It is now read-only.

Commit

Permalink
I swear Ialready fixed these tests before
Browse files Browse the repository at this point in the history
  • Loading branch information
benreyn committed Jul 29, 2019
1 parent 2b86a61 commit 4d7584e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
3 changes: 2 additions & 1 deletion spec/features/add_child_to_family_feature_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

describe Child, type: :feature do
let!(:partner) { create(:partner, id: 3) }
let!(:user) { create(:user, partner: partner) }
let!(:family) { create(:family, partner: partner) }

before do
sign_in(partner)
sign_in(user)
visit(families_path)
end

Expand Down
3 changes: 2 additions & 1 deletion spec/features/authorized_family_member_feature_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

describe AuthorizedFamilyMember, type: :feature do
let!(:partner) { create(:partner, id: 3) }
let!(:user) { create(:user, partner: partner) }
let!(:family) { create(:family, partner: partner) }

before do
sign_in(partner)
sign_in(user)
visit(families_path)
end

Expand Down
5 changes: 3 additions & 2 deletions spec/features/partner_approval_feature_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
require "rails_helper"

describe "Partner approval", type: :feature do
scenario "Submit for approval button is present when partner requires recertification", js: true do
scenario "Submit for approval button is present when partner requires recertification" do
partner = create(:partner, partner_status: "recertification_required")
sign_in(partner)
user = create(:user, partner: partner)
sign_in(user)
visit "/partners/#{partner.id}"

stub_request(:post, "#{ENV["DIAPERBANK_ENDPOINT"]}/approvals/")
Expand Down
5 changes: 3 additions & 2 deletions spec/mailers/recertification_mailer_spec.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
describe RecertificationMailer, type: :mailer do
describe "notice_email" do
let!(:partner) { create(:partner) }
let!(:user) { create(:user) }
let!(:partner) { create(:partner, user: user) }
let!(:mail) { RecertificationMailer.with(partner: partner).notice_email.deliver_now }

it "email renders the subject" do
expect(mail.subject).to eq("Please update your agency information")
end

it "email renders the receiver email" do
expect(mail.to).to eq([partner.email])
expect(mail.to).to eq([partner.user.email])
end

it "email renders the sender email" do
Expand Down
3 changes: 2 additions & 1 deletion spec/requests/api/v1/partners_requests_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
end

context "when we set the partner to recertification_required" do
let(:partner) { create(:partner) }
let(:user) { create(:user) }
let(:partner) { create(:partner, user: user) }
let(:params) { { partner: { diaper_partner_id: partner.diaper_bank_id, status: "recertification_required" } } }

it "returns OK" do
Expand Down

0 comments on commit 4d7584e

Please sign in to comment.