Sha256: c03038500b610ea150ea29c95a95f34931b8c76b73ef3dac9bbfd1e7093c52c0

Contents?: true

Size: 723 Bytes

Versions: 9

Compression:

Stored size: 723 Bytes

Contents

require 'test_helper'

class LineItemsControllerTest < ActionController::TestCase
  context "on DELETE to :destroy" do
    setup do 
      set_current_user
      @order = create_complete_order
      @order_total = @order.total
      @line_item = @order.line_items.first
      delete :destroy, :order_id => @order.id, :id => @line_item.id
    end
    
    should_redirect_to("edit order page") { edit_order_url(@order) }
    should_not_set_the_flash    
    
    should "delete the line item" do
      line_items = @order.line_items.reload
      assert_does_not_contain(line_items, @line_item)
    end
    
    should "update the order totals" do
      assert_not_equal @order_total, @order.reload.total
    end
  end
  
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
spree-0.11.4 test/functional/line_items_controller_test.rb
spree-0.11.3 test/functional/line_items_controller_test.rb
spree-0.11.2 test/functional/line_items_controller_test.rb
spree-0.11.1 test/functional/line_items_controller_test.rb
spree-0.11.0 test/functional/line_items_controller_test.rb
spree-0.10.2 test/functional/line_items_controller_test.rb
spree-0.10.1 test/functional/line_items_controller_test.rb
spree-0.10.0 test/functional/line_items_controller_test.rb
spree-0.10.0.beta test/functional/line_items_controller_test.rb