Sha256: 583eeb50b395c73629911eaef933e60edc1c855a9cc862ad627839011dfd2dc6

Contents?: true

Size: 1.93 KB

Versions: 5

Compression:

Stored size: 1.93 KB

Contents

require 'spec_helper'

describe "with an account and transaction" do
  let(:account) { Factory(:paid_account) }

  before do
    subscription = FakeBraintree.subscriptions[account.subscription_token]
    subscription["transactions"] = [FakeBraintree.generated_transaction]
  end

  describe BillingMailer, "receipt" do
    subject { BillingMailer.receipt(account, account.subscription.transactions.first) }

    it "sends the receipt mail from the support address" do
      subject.from.should == [Saucy::Configuration.support_email_address]
    end

    it "sets the receipt mail reply-to to the support address" do
      subject.reply_to.should == [Saucy::Configuration.support_email_address]
    end
  end

  describe BillingMailer, "problem" do
    subject { BillingMailer.problem(account, account.subscription.transactions.first) }

    it "sends the problem mail from the support address" do
      subject.from.should == [Saucy::Configuration.support_email_address]
    end

    it "sets the problem mail reply-to to the support address" do
      subject.reply_to.should == [Saucy::Configuration.support_email_address]
    end
  end

  describe BillingMailer, "expiring trial" do
    subject { BillingMailer.expiring_trial(account) }

    it "sends the expiring trial mail from the support address" do
      subject.from.should == [Saucy::Configuration.manager_email_address]
    end

    it "sets the expiring trial mail reply-to to the support address" do
      subject.reply_to.should == [Saucy::Configuration.support_email_address]
    end
  end

  describe BillingMailer, "new unactivated" do
    subject { BillingMailer.expiring_trial(account) }

    it "sends the new unactivated mail from the support address" do
      subject.from.should == [Saucy::Configuration.manager_email_address]
    end

    it "sets the new unactivated mail reply-to to the support address" do
      subject.reply_to.should == [Saucy::Configuration.support_email_address]
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
saucy-0.8.0 spec/mailers/billing_mailer_spec.rb
saucy-0.7.3 spec/mailers/billing_mailer_spec.rb
saucy-0.7.2 spec/mailers/billing_mailer_spec.rb
saucy-0.7.1 spec/mailers/billing_mailer_spec.rb
saucy-0.7.0 spec/mailers/billing_mailer_spec.rb