-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DeadGhost Betsy #15
base: master
Are you sure you want to change the base?
DeadGhost Betsy #15
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be simplified by doing product.status = !product.status
|
||
private | ||
|
||
def review_params |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This controller's indentation also needs work
@@ -0,0 +1,33 @@ | |||
class CategoriesController < ApplicationController |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job on this one
acceptable.valid?.must_equal true | ||
acceptable.errors.messages.wont_include :name | ||
|
||
no_category = categories(:nocategory) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation!
|
||
it "should create an order" do | ||
proc { | ||
Order.create |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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