Skip to content
Snippets Groups Projects
Commit dd1c4c1c authored by Butler, Alexis (UG - Computer Science)'s avatar Butler, Alexis (UG - Computer Science)
Browse files

Passed carts contoller tests

parent 686e2482
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,8 @@ class CartsController < ApplicationController ...@@ -9,7 +9,8 @@ class CartsController < ApplicationController
item["Num"] += 1 item["Num"] += 1
cart[prod_id] = item cart[prod_id] = item
update_cart cart update_cart cart
redirect_back fallback_location: :root_url flash[:success] = "Item added to cart"
redirect_back fallback_location: :root
end end
end end
...@@ -21,6 +22,7 @@ class CartsController < ApplicationController ...@@ -21,6 +22,7 @@ class CartsController < ApplicationController
cart[prod_id] = item cart[prod_id] = item
cart.delete(prod_id) if item["Num"] < 1 cart.delete(prod_id) if item["Num"] < 1
update_cart cart update_cart cart
redirect_back fallback_location: :root_url flash[:success] = "Item removed from cart"
redirect_back fallback_location: :root
end end
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment