-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
completely removed old (should) rspec expectation format in favour of…
… new (expect) expectation format, so that same format is used accross all tests
- Loading branch information
Showing
8 changed files
with
113 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
shared_examples :mail do | ||
it "should set text body for plain message" do | ||
Postmark.send(:convert_message_to_options_hash, subject)['TextBody'].should_not be_nil | ||
it "set text body for plain message" do | ||
expect(Postmark.send(:convert_message_to_options_hash, subject)['TextBody']).not_to be_nil | ||
end | ||
|
||
it "should encode from properly when name is used" do | ||
it "encode from properly when name is used" do | ||
subject.from = "Sheldon Lee Cooper <[email protected]>" | ||
subject.should be_serialized_to %q[{"Subject":"Hello!", "From":"Sheldon Lee Cooper <[email protected]>", "To":"[email protected]", "TextBody":"Hello Sheldon!"}] | ||
expect(subject).to be_serialized_to %q[{"Subject":"Hello!", "From":"Sheldon Lee Cooper <[email protected]>", "To":"[email protected]", "TextBody":"Hello Sheldon!"}] | ||
end | ||
|
||
it "should encode reply to" do | ||
it "encode reply to" do | ||
subject.reply_to = ['[email protected]', '[email protected]'] | ||
subject.should be_serialized_to %q[{"Subject":"Hello!", "From":"[email protected]", "ReplyTo":"[email protected], [email protected]", "To":"[email protected]", "TextBody":"Hello Sheldon!"}] | ||
expect(subject).to be_serialized_to %q[{"Subject":"Hello!", "From":"[email protected]", "ReplyTo":"[email protected], [email protected]", "To":"[email protected]", "TextBody":"Hello Sheldon!"}] | ||
end | ||
|
||
it "should encode tag" do | ||
it "encode tag" do | ||
subject.tag = "invite" | ||
subject.should be_serialized_to %q[{"Subject":"Hello!", "From":"[email protected]", "Tag":"invite", "To":"[email protected]", "TextBody":"Hello Sheldon!"}] | ||
expect(subject).to be_serialized_to %q[{"Subject":"Hello!", "From":"[email protected]", "Tag":"invite", "To":"[email protected]", "TextBody":"Hello Sheldon!"}] | ||
end | ||
|
||
it "should encode multiple recepients (TO)" do | ||
it "encode multiple recepients (TO)" do | ||
subject.to = ['[email protected]', '[email protected]'] | ||
subject.should be_serialized_to %q[{"Subject":"Hello!", "From":"[email protected]", "To":"[email protected], [email protected]", "TextBody":"Hello Sheldon!"}] | ||
expect(subject).to be_serialized_to %q[{"Subject":"Hello!", "From":"[email protected]", "To":"[email protected], [email protected]", "TextBody":"Hello Sheldon!"}] | ||
end | ||
|
||
it "should encode multiple recepients (CC)" do | ||
it "encode multiple recepients (CC)" do | ||
subject.cc = ['[email protected]', '[email protected]'] | ||
subject.should be_serialized_to %q[{"Cc":"[email protected], [email protected]", "Subject":"Hello!", "From":"[email protected]", "To":"[email protected]", "TextBody":"Hello Sheldon!"}] | ||
expect(subject).to be_serialized_to %q[{"Cc":"[email protected], [email protected]", "Subject":"Hello!", "From":"[email protected]", "To":"[email protected]", "TextBody":"Hello Sheldon!"}] | ||
end | ||
|
||
it "should encode multiple recepients (BCC)" do | ||
it "encode multiple recepients (BCC)" do | ||
subject.bcc = ['[email protected]', '[email protected]'] | ||
subject.should be_serialized_to %q[{"Bcc":"[email protected], [email protected]", "Subject":"Hello!", "From":"[email protected]", "To":"[email protected]", "TextBody":"Hello Sheldon!"}] | ||
expect(subject).to be_serialized_to %q[{"Bcc":"[email protected], [email protected]", "Subject":"Hello!", "From":"[email protected]", "To":"[email protected]", "TextBody":"Hello Sheldon!"}] | ||
end | ||
|
||
it "should accept string as reply_to field" do | ||
it "accept string as reply_to field" do | ||
subject.reply_to = ['Anton Astashov <[email protected]>'] | ||
subject.should be_serialized_to %q[{"From": "[email protected]", "ReplyTo": "[email protected]", "To": "[email protected]", "Subject": "Hello!", "TextBody": "Hello Sheldon!"}] | ||
expect(subject).to be_serialized_to %q[{"From": "[email protected]", "ReplyTo": "[email protected]", "To": "[email protected]", "Subject": "Hello!", "TextBody": "Hello Sheldon!"}] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,11 @@ | |
let(:target) { {"From" => "[email protected]", "ReplyTo" => "[email protected]"} } | ||
|
||
it 'converts Hash keys to Postmark format' do | ||
subject.to_postmark(source).should == target | ||
expect(subject.to_postmark(source)).to eq target | ||
end | ||
|
||
it 'acts idempotentely' do | ||
subject.to_postmark(target).should == target | ||
expect(subject.to_postmark(target)).to eq target | ||
end | ||
end | ||
|
||
|
@@ -19,16 +19,15 @@ | |
let(:target) { {:from => "[email protected]", :reply_to => "[email protected]"} } | ||
|
||
it 'converts Hash keys to Ruby format' do | ||
subject.to_ruby(source).should == target | ||
expect(subject.to_ruby(source)).to eq target | ||
end | ||
|
||
it 'has compatible mode' do | ||
subject.to_ruby(source, true).should == target.merge(source) | ||
expect(subject.to_ruby(source, true)).to eq target.merge(source) | ||
end | ||
|
||
it 'acts idempotentely' do | ||
subject.to_ruby(target).should == target | ||
expect(subject.to_ruby(target)).to eq target | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.