<commit_before>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<commit_msg>Add stub_authorization to admin/shipping_methods controller spec<commit_after>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
{'fraction_non_alphanumeric': 0.08722741433021806, 'fraction_numerical': 0.010384215991692628, 'mean_word_length': 6.53125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4556253', 'n_tokens_mistral': 301, 'n_tokens_neox': 291, 'n_words': 57}