Skip to content

Commit

Permalink
added test with barney the purple dinosaur
Browse files Browse the repository at this point in the history
  • Loading branch information
ArushC committed Feb 20, 2024
1 parent c231e07 commit be305ef
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/fixtures/teachers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,16 @@ reimu:
school: berkeley
application_status: Info Needed
education_level: -1

barney:
id: 6
first_name: Barney
last_name: Dinosaur
snap: barney
email: '[email protected]'
personal_email: '[email protected]'
status: 1
more_info: ''
application_status: Denied
school: berkeley
education_level: -1
11 changes: 11 additions & 0 deletions spec/mailers/teacher_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@
expect(email.body.encoded).to include("Hi Bob")
end

it "Sends to Both School and Personal Email When Possible" do
teacher = teachers(:barney)
email = TeacherMailer.welcome_email(teacher)
email.deliver_now
expect(email.from[0]).to eq("[email protected]")
expect(email.to[0]).to eq("[email protected]")
expect(email.to[1]).to eq("[email protected]")
expect(email.subject).to eq("Welcome to The Beauty and Joy of Computing!")
expect(email.body.encoded).to include("Hi Barney")
end


it "Sends Deny Email" do
teacher = teachers(:long)
Expand Down

0 comments on commit be305ef

Please sign in to comment.