require 'spec_helper'

describe Spree::Admin::ShippingMethodsController do
  
  # Regression test for #1240
  it "should not hard-delete shipping methods" do
    Spree::ShippingMethod.should_receive(:find).and_return(shipping_method = stub_model(Spree::ShippingMethod))
    shipping_method.should_not_receive(:destroy)
    shipping_method.should_receive(:update_attribute)
    spree_delete :destroy, :id => 1
  end
end

require 'spec_helper'

describe Spree::Admin::ShippingMethodsController do
  stub_authorization!
  
  # Regression test for #1240
  it "should not hard-delete shipping methods" do
    Spree::ShippingMethod.should_receive(:find).and_return(shipping_method = stub_model(Spree::ShippingMethod))
    shipping_method.should_not_receive(:destroy)
    shipping_method.should_receive(:update_attribute)
    spree_delete :destroy, :id => 1
  end
end

Add stub_authorization to admin/shipping_methods controller spec
Add stub_authorization to admin/shipping_methods controller spec
