-
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
Ampers - Kate, Steffany, Brittany, Lily #22
base: master
Are you sure you want to change the base?
Conversation
merging to update schema
…reated isn't working yet
…troller so that a new pending order is created for each new guest
…oducts Feature_Adds more db seeds and db updates
Adding uid to order
…ugh I did make one for self.merchant_products
Category controller tests + new form
…OrderItemsTesting
hotfix for showing mechant shops while logged out
Feature all users page
Order order items testing
changes title of site
changed new method in product controller
bEtsyWhat We're Looking For
Only the person who submitted the PR will get an email about this feedback. Please let the rest of your team know about it. |
end | ||
|
||
describe "new" do | ||
it "succeeds" 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.
Shouldn't you be making sure that guest users can't create a new category? Guests shouldn't be able to get to the form.
end | ||
end | ||
|
||
describe "create" 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.
You also need to verify that guest users can't create categories, so you're missing some tests.
@@ -0,0 +1,38 @@ | |||
class Product < ApplicationRecord |
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.
Why is this model in the test/controllers folder?
|
||
describe "new" do | ||
it "succeeds" do | ||
user = users(:ada) |
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.
Guest users shouldn't be able to get to the form to create a new product.
|
||
describe "create" do | ||
it "creates a product with valid data" do | ||
Product.count.must_equal 3 |
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.
You also haven't ensured that people who haven't logged in can create products.
|
||
describe "show" do | ||
it "succeeds" do | ||
get product_path(products(:cat)) |
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 test fails because it can't find the merchant.
proc { | ||
put order_path(order.id), params: { order: order_info } | ||
product = Product.find(item.product_id) | ||
}.must_change 'product.stock', -2 |
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 test is failing, probably because it's not creating an orderItem properly.
@@ -0,0 +1,76 @@ | |||
class ProductsController < 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.
In these controllers you have no security. Nothing prevents guest users from getting into mischief.
<div class="body-wrapper"> | ||
<header class="clearfix"> | ||
<section class="site-title"> | ||
<h1>Welcome To Petsy</h1> |
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 this header be a link to the homepage.
</head> | ||
|
||
<body> | ||
<div class="body-wrapper"> |
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 purpose does the body-wrapper
div
element perform. Why not just style the body
element?
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