Conversation
…. Added seed data for merchants
…product controller
… on testing errors
…atus and added migration to set order status default to pending
bEtsyWhat We're Looking For
|
|
|
||
| def product_status | ||
| product = Product.find_by_id(params[:id]) | ||
| if !product.status |
There was a problem hiding this comment.
This should be simplified by doing product.status = !product.status
|
|
||
| private | ||
|
|
||
| def review_params |
There was a problem hiding this comment.
eek! indentation in this controller needs work
|
|
||
| #creates an array of 2-element arrays where the first element is the category name and the second is the category id. | ||
| #use this array in the form to create a product in a select helper where the names are what shows up in the view and IDs are the values that get passed to the create/update action | ||
| def category_names |
There was a problem hiding this comment.
This should come from the category model, not a controller
| order = Order.create | ||
| session[:order_id] = order.id | ||
| end | ||
| end |
There was a problem hiding this comment.
This controller's indentation also needs work
| @@ -0,0 +1,33 @@ | |||
| class CategoriesController < ApplicationController | |||
| acceptable.valid?.must_equal true | ||
| acceptable.errors.messages.wont_include :name | ||
|
|
||
| no_category = categories(:nocategory) |
There was a problem hiding this comment.
Seems like this is the duplicate code to above
| merchant.valid?.must_equal false | ||
| merchant.errors.messages.must_include :username | ||
| #merchant with username is good | ||
| merchants(:dan).valid?.must_equal true |
There was a problem hiding this comment.
These should really be two separate tests. One is testing the validation and the other is testing that it would work
|
|
||
| describe OrderItemsController do | ||
|
|
||
| it "should create an order item product" do |
|
|
||
| it "should create an order" do | ||
| proc { | ||
| Order.create |
There was a problem hiding this comment.
It seems odd that you can create an Order with nothing
|
|
||
| <h3 class="centering">Ghosty Products for ghosty needs</h3> | ||
|
|
||
| <h3 class="columns large-12 small-12"><%= @product_filter %></h3> |
There was a problem hiding this comment.
If you have the diff sizes with the same values its not going to do you much good
bEtsy
Congratulations! You're submitting your assignment! These comprehension questions should be answered by all members of your team, not by a single teammate.
Comprehension Questions