Skip to content
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

Spaghettsi - Amanda, Christina, Daniela, Hannah #17

Open
wants to merge 619 commits into
base: master
Choose a base branch
from

Conversation

hertweckhr1
Copy link

@hertweckhr1 hertweckhr1 commented Oct 26, 2018

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

Question Answer
Each team member: what is one thing you were primarily responsible for that you're proud of? Amanda: omniauth and authorization, Christina: reviews and controller testing, Daniela: Shopping Cart, orders, logic, Hannah: user experience , HTML/CSS/Bootstrap
Each team member: what is one thing you were primarily responsible for that you would like targeted feedback on? Please see above responsibilities - we each welcome feedback in all of those areas.
How did your team break up the work to be done? We each picked categories to work on based on interest and what was needed. Hannah expressed interest in learning more Bootstrap, Daniela wanted to work only back-end logic, Christina was willing to take on any area provided I would't kill the site.
How did your team utilize git to collaborate? In best possible cases, we each worked off our own branches then merged to the master when work was complete and bug free.
What did your group do to try to keep your code DRY while many people collaborated on it? We often paired up to have two eyes on task and worked on drying code once we were complete. If we had more time we would sweep through the entire codebase, especially our routes (we are sure that we have many unused routes and due to time constraints were not able to clean this up by EOD Friday).
What was a technical challenge that you faced as a group? We had a situation where we could not update products in the cart, because the form was split between different html containers and not rendering correctly. We fixed it by giving the form an id and linking each form field to that id. (Seen in shopping cart html)
What was a team/personal challenge that you faced as a group? Each of us had personal affairs and emotional situations going on that would interrupt with project time. We worked on meeting each other where we were at and still keeping structure to what was being done/expected each day.
What was your application's ERD? (include a link) https://www.lucidchart.com/invitations/accept/7e968e2e-8ee9-4067-a2bc-d3da6ceae716
What is your Trello URL? https://trello.com/b/SHDoGJdG/spaghettsi
What is the Heroku URL of your deployed application? https://spagh-ettsi.herokuapp.com/

@hertweckhr1
Copy link
Author

Hey Chris - all tests were looking super swell! In order to deploy to heroku, we needed to cahnge the semantics of the image tags - when this happened we got a few errors on our tests. Wanted to give you a heads up on this, and maybe we can over a solution, next week to this. Charles was unable to solve in the limited time we had.

@hertweckhr1
Copy link
Author

Don't forget to checkout our facebook and twitter :-D

@CheezItMan
Copy link

bEtsy

What We're Looking For

Feature Feedback
Baseline
Appropriate Git Usage with all members contributing Lots of commits and good commit messages
Answered comprehension questions Check, I'll try to look at those areas
Trello board is created and utilized in project management Check
Heroku instance is online Check
General
Nested routes follow RESTful conventions You have a TON of unused routes. So many I didn't bother to count'em all. This is wasteful and could lead to the app crashing if unused routes are accessed.
oAuth used for User authentication Check
Functionality restricted based on user roles I was able to go into another merchant's order and ship it! Doh! Lots of similar issues in your controllers.
Products can be added and removed from cart Check
Users can look up past orders by ID Yes, although I can peek at Hannah's order #55
Merchants can add, edit and view their products Check
Errors are reported to the user Check
Order Functionality
Reduces products' inventory Check, although it reduces the inventory based on the cart. If a bunch of people add things to their carts, they could block a merchant from selling anything.
Cannot order products that are out of stock Check
Changes order state Check
Clears current cart Check
Database
ERD includes all necessary tables and relationships Check
Table relationships Check
Models
Validation rules for Models Check
Business logic is in the models Check
Controllers
Controller Filters used to DRY up controller code Check
Testing 12 erring tests
Model Testing One bug that I found in , see comments
Controller Testing Check, see my test comments
Session Testing Check, but you didn't test the logout functionality
SimpleCov at 90% for controller and model tests 98% coverage
Front-end
The app is styled to create an attractive user interface The site looks good
Content is organized with HTML5 semantic tags Fairly semantic HTML, good use of head and footer and nav
CSS is DRY Some repeated styles, but mostly DRY
Overall Overall, nice work. You have some issues with permissions, and unused routes as well as some testing issues. You hit the learning goals, but I would advise you to review my comments especially on tests, and review your routes.rb files to ensure you don't have unused routes.

Only the person who submitted the PR will get an email about this feedback. Please let the rest of your team know about it.

category: long
description: this is a box of spaghetti
is_active: true
image_url: http

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field is causing controller tests to fail because it's not giving the local address of an image in the assets folder. Either provide a full path to something on the internet or, a path to something in the assets folder.

category: 'short',
quantity: 100,
description: 'these ones are ziti',
image_url: http

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is http?

mock_params[:order_product][:product_id] = nil

expect {
post order_products_path, params: mock_params

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is failing because it's trying to access user_id for a nil object.



quantity = params[:order_product][:quantity]
if product.user_id == session[:user_id]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to first check to see if product is nil!

valid = review.valid?

expect(valid).must_equal false
expect(review.errors.messages[:rating]).must_equal "can't be blank", "Rating must be greater than 0", "We're flattered but this product can

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must_equal only takes 1 argument. So this should be an array like

must_equal ["can't be blank", "Rating must be greater than 0", "We're flattered but this product can only be rated out of 5."]

end

def update
if order_product = OrderProduct.find_by(id: params[:order_product][:id])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No test to make sure the current user is the "owner" of the product.


def show

if !@order || @order.status == 'pending' || @order.user != @login_user

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

end

def mark_as_shipped
if @order.status != 'complete'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So anyone can mark an order as shipped?

redirect_to products_path
flash[:warning] = "Error: Cannot checkout, cart is empty."

elsif !@login_user.update(user_params)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like it would let anyone take over someone else's order.

@@ -0,0 +1,47 @@
class PaymentsController < ApplicationController
before_action :find_card_types, only: [:new, :edit, :update, :create]
def index

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's nothing here to prevent someone else from seeing the payment of another user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants