spec/integration_spec.rb in simple_postmark-0.4.4 vs spec/integration_spec.rb in simple_postmark-0.5.0

- old
+ new

@@ -4,11 +4,11 @@ require 'simple_postmark/railtie' WebMock.allow_net_connect! class IntegrationMailer < ActionMailer::Base - default to: ENV['SIMPLE_POSTMARK_TO'], from: ENV['SIMPLE_POSTMARK_FROM'] + default from: 'barney@himym.tld', to: 'ted@himym.tld' def text 'Mail send via Postmark using SimplePostmark' end @@ -31,19 +31,19 @@ as.text { render(text: text) } end end def email_with_reply_to - mail(subject: 'SimplePostmark with Reply To', reply_to: ENV['SIMPLE_POSTMARK_REPLY_TO']) do |as| + mail(subject: 'SimplePostmark with Reply To', reply_to: 'barney@barneystinsonblog.com') do |as| as.text { render(text: text) } end end end describe 'SimplePostmark integration' do before do - ActionMailer::Base.simple_postmark_settings = { api_key: ENV['SIMPLE_POSTMARK_API_KEY'], return_response: true } + ActionMailer::Base.simple_postmark_settings = { api_key: 'POSTMARK_API_TEST', return_response: true } ActionMailer::Base.raise_delivery_errors = true end it 'sends emails' do @@ -85,18 +85,18 @@ end describe 'setting return_response option' do before do - ActionMailer::Base.simple_postmark_settings = { api_key: ENV['SIMPLE_POSTMARK_API_KEY'], return_response: true } + ActionMailer::Base.simple_postmark_settings = { api_key: 'POSTMARK_API_TEST', return_response: true } end it 'returns the response from postmarkapp.com' do response = IntegrationMailer.email.deliver!.parsed_response - response['To'].must_equal(ENV['SIMPLE_POSTMARK_TO']) - response['Message'].must_equal('OK') + response['To'].must_equal('ted@himym.tld') + response['Message'].must_equal('Test job accepted') response['MessageID'].wont_be_empty end end end if ENV['SIMPLE_POSTMARK_INTEGRATION_SPEC']