Sha256: 34a09177786cee51978d2de275c31539c32529baeda77882cf200ab059050a59

Contents?: true

Size: 415 Bytes

Versions: 3

Compression:

Stored size: 415 Bytes

Contents

module ShoppingCart
  RSpec.describe OrderItemsController, type: :controller do
    routes { ShoppingCart::Engine.routes }

    login_user

    describe 'DELETE #destroy' do
      before do
        @item = create :order_item
      end

      it 'deletes requested item' do
        expect{
          delete :destroy, params: { id: @item.id }
        }.to change(OrderItem, :count).by(-1)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
shopping-cart-0.1.2 spec/conrollers/shopping_cart/order_items_controller_spec.rb
shopping-cart-0.1.1 spec/conrollers/shopping_cart/order_items_controller_spec.rb
shopping-cart-0.1.0 spec/conrollers/shopping_cart/order_items_controller_spec.rb