-
Notifications
You must be signed in to change notification settings - Fork 14
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
m^gj*c #62
base: master
Are you sure you want to change the base?
m^gj*c #62
Conversation
Cw/user profile
Can only create a category on the category/show page if you are logge…
some styling for the users#show page
…ders_controller for the checkout process
products can now be created with categories
…cific product. Have not tested yet
…testing in order, orderproducts and products tomorrow
Cw/views fixes
removing
Cw/views fixes
final deployment for show
removed duplicate price
proceed to checkout
bEtsyWhat We're Looking For
IMPORTANT: Whoever submitted the PR (and thus will get the notification about this feedback) should share this with their teammates. |
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.
A few comments
validates :credit_card_name, presence: true | ||
validates :credit_card_number, presence: true | ||
validates :credit_card_cvv, presence: true | ||
validates :billing_zip_code, presence: 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.
More validations would be good, but you probably ran out of time.
class Item < ApplicationRecord | ||
belongs_to :product | ||
belongs_to :order, optional: true | ||
validates :shipping_status, inclusion: {in: [true,false]} |
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 that you could combine shipping status and purchase status
validates :shipping_status, inclusion: {in: [true,false]} | ||
validates :purchase_status, inclusion: {in: [true,false]} | ||
|
||
def purchase(input_order_id) |
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 that you're putting business logic in the model.
|
||
def has_billing_datum? | ||
if self.order_status != "pending" | ||
self.errors[:billing_datum_id] << "is missing. Please entire valid billing information." if !(self.billing_datum_id) |
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.
Please entire
???
end | ||
|
||
#gets called if check_for_duplicates returns true | ||
#TODO: Julia removed below method. Does not appear to be applied in any part of the project. |
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 idea to leave notes like this for future work.
@@ -0,0 +1,41 @@ | |||
require "test_helper" | |||
|
|||
describe SessionsController 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.
What about a test for when a user visits the callback path without logging in?
must_redirect_to product_path(products(:converse).id) | ||
end | ||
|
||
it "If correct info is not provided, render new" 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.
What is this doing in the controller test?
|
||
get product_path(products(:converse).id) | ||
|
||
controller.instance_variable_get("@current_user_is_not_product_owner").must_equal false |
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 probably just be a test for redirect
name: product.name + " updated" | ||
} | ||
} | ||
patch product_path(product), params: product_datum |
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.
Shouldn't you use a must... something
|
||
|
||
describe "new" do | ||
it "can reach a new category" 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.
What about guest vs logged in users?
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