Skip to content

Commit

Permalink
From Spec green!
Browse files Browse the repository at this point in the history
  • Loading branch information
dgoerlich committed Mar 31, 2016
1 parent bb5e868 commit d08ecf5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
24 changes: 24 additions & 0 deletions spec/from_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
require 'spec_helper'

describe SparkPostRails::DeliveryMethod do

before(:each) do
@delivery_method = SparkPostRails::DeliveryMethod.new
end

context "From" do
it "handles email only" do
test_email = Mailer.test_email
@delivery_method.deliver!(test_email)

expect(@delivery_method.data[:content][:from]).to eq({email: "[email protected]"})
end

it "handles name and email" do
test_email = Mailer.test_email from: "Joe Test <[email protected]>"
@delivery_method.deliver!(test_email)

expect(@delivery_method.data[:content][:from]).to eq({:email=>"[email protected]", :name=>"Joe Test"})
end
end
end
3 changes: 0 additions & 3 deletions spec/recipients_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@

expect(@delivery_method.data[:recipients]).to eq([{:address=>{:email=>"[email protected]", :name=>"Sam Test"}}, {:address=>{:email=>"[email protected]"}}])
end

end

end

end

0 comments on commit d08ecf5

Please sign in to comment.