Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe Merchant, "who wants to unsubscribe" do
- before(:each) do
- @merchant = Merchant.create!(valid_merchant_params)
- @merchant.unsubscribe_email("unsubscribed@email.com")
- end
- it "should consider email unsubscribed if it present in unsubscribed_emails" do
- @merchant.email_unsubscribed?("unsubscribed@email.com").should be_true
- end
- it "should consider email unsubscribed if it present in unsubscribed_emails and formated as 'Some Name <email@addrr.ess>'" do
- @merchant.email_unsubscribed?("Some Guy <unsubscribed@email.com>").should be_true
- end
- it "should not consider email unsubscribed if it not present in unsubscribed_emails" do
- @merchant.email_unsubscribed?("some@email.com").should_not be_true
- end
- it "should save only email address when unsubscribing 'Some Name <email@addrr.ess>'" do
- @merchant.unsubscribe_email(' "Silly Name" < sally@walking.net > ')
- @merchant.email_unsubscribed?(" 'Other Name' <sally@walking.net> ").should be_true
- end
- end
Add Comment
Please, Sign In to add comment