Sha256: b406f569057101a95007c9ec4344bd7cf27f1a66ce227c58287601ae423faa3d

Contents?: true

Size: 839 Bytes

Versions: 2

Compression:

Stored size: 839 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper'

describe Admin::MailMethodsController do
  let(:order) { mock_model(Order, :complete? => true).as_null_object }
  let(:mail_method) { mock_model(MailMethod).as_null_object }

  before do
    #controller.stub :current_user => nil
    Order.stub :find => order
    MailMethod.stub :find => mail_method
  end

  context "#create" do
    it "should reinitialize the mail settings" do
      Spree::MailSettings.should_receive :init
      put :create, {:order_id => "123", :id => "456", :mail_method_parmas => {:environment => "foo"}}
    end
  end

  context "#update" do
    it "should reinitialize the mail settings" do
      Spree::MailSettings.should_receive :init
      put :update, {:order_id => "123", :id => "456", :mail_method_parmas => {:environment => "foo"}}
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
MyCommerceapi-1.0.0 core/spec/controllers/admin/mail_methods_controller_spec.rb
MyCommerce-0.0.3 core/spec/controllers/admin/mail_methods_controller_spec.rb