Sha256: 50ba9b13265531895bbfa25bfa7818c9615754bfef68a623cbccd73dbf637787

Contents?: true

Size: 855 Bytes

Versions: 8

Compression:

Stored size: 855 Bytes

Contents

shared_examples "with header" do |header, value|
  it "sets header #{header}" do
    expect {
      subject.deliver!
    }.to change { ActionMailer::Base.deliveries.count }.by(1)
    m = ActionMailer::Base.deliveries.last
    expect(m.header.to_s).to match(/(\r\n)?#{header}: #{value}(\r\n)?/)
  end
end
shared_examples "without header" do |header|
  it "does not set header #{header}" do
    expect {
      subject.deliver!
    }.to change { ActionMailer::Base.deliveries.count }.by(1)
    m = ActionMailer::Base.deliveries.last
    expect(m.header.to_s).not_to match(/(\r\n)?#{header}: [^\r]*(\r\n)?/)
  end
end
shared_examples "raise an exception" do |exception|
  it "raises #{exception}" do
    expect {
      expect {
        subject.deliver!
      }.to raise_error(exception)
    }.to change { ActionMailer::Base.deliveries.count }.by(0)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mandriller-0.1.1 spec/support/action_mailer.rb
mandriller-0.1.0 spec/support/action_mailer.rb
mandriller-0.0.7 spec/support/action_mailer.rb
mandriller-0.0.6 spec/support/action_mailer.rb
mandriller-0.0.5 spec/support/action_mailer.rb
mandriller-0.0.4 spec/support/action_mailer.rb
mandriller-0.0.3 spec/support/action_mailer.rb
mandriller-0.0.1 spec/support/action_mailer.rb