WIP Preparing to get rid of MailMethod model

Please give a look at the following links:
 - http://guides.spreecommerce.org/release_notes/spree_2_0_0.html#mailmethod-model-no-longer-exists
 - https://github.com/spree/spree/pull/2643
This commit is contained in:
enricostano
2017-04-19 17:31:14 +02:00
committed by Rob Harrington
parent 22b5431279
commit cf4bd8d755
4 changed files with 23 additions and 0 deletions

View File

@@ -179,6 +179,12 @@ describe Spree::Admin::OrdersController do
context "when the distributor's ABN has been set" do
before { distributor.update_attribute(:abn, "123") }
before do
Spree::MailMethod.create!(
environment: Rails.env,
preferred_mails_from: 'spree@example.com'
)
end
it "should allow me to send order invoices" do
expect do
spree_get :invoice, params

View File

@@ -19,6 +19,10 @@ describe Spree::OrderMailer do
ship_address = create(:address, :address1 => "distributor address", :city => 'The Shire', :zipcode => "1234")
@order1 = create(:order, :distributor => @distributor, :bill_address => @bill_address, ship_address: ship_address, :special_instructions => @shipping_instructions)
ActionMailer::Base.deliveries = []
Spree::MailMethod.create!(
environment: Rails.env,
preferred_mails_from: 'spree@example.com'
)
end
describe "order confirmation for customers" do

View File

@@ -2,6 +2,12 @@ require 'spec_helper'
require 'yaml'
describe ProducerMailer do
before do
Spree::MailMethod.create!(
environment: Rails.env,
preferred_mails_from: 'spree@example.com'
)
end
let!(:zone) { create(:zone_with_member) }
let!(:tax_rate) { create(:tax_rate, included_in_price: true, calculator: Spree::Calculator::DefaultTax.new, zone: zone, amount: 0.1) }
let!(:tax_category) { create(:tax_category, tax_rates: [tax_rate]) }

View File

@@ -487,6 +487,13 @@ describe Spree::Order do
describe "scopes" do
describe "not_state" do
before do
Spree::MailMethod.create!(
environment: Rails.env,
preferred_mails_from: 'spree@example.com'
)
end
it "finds only orders not in specified state" do
o = FactoryGirl.create(:completed_order_with_totals)
o.cancel!