Acceptance tests for user

This commit is contained in:
2015-09-17 17:46:33 +02:00
parent 8e931cabd4
commit cb744943bd
35 changed files with 91 additions and 49 deletions
+6 -1
View File
@@ -14,7 +14,7 @@ module Users
#EMBER
def current
@list = current_user.active_list
params[:id] = @list.id # serializer determines collection or not based on the presence of this
params[:id] = @list.try(:id) # serializer determines collection or not based on the presence of this
show
end
@@ -67,6 +67,11 @@ module Users
# POST /user/lists/:id/order_products
def order_products
res = {}
unless active_list.present?
res[:list_closed] = true
render json: res, status: 404
return
end
res[:supplier_closed] = active_list.supplier.closed?
unless res[:supplier_closed]
# Create new list