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

Pipes - Iuliia, Eva, Lindsey, Rebecca - Betsy #66

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

Conversation

julalam
Copy link

@julalam julalam commented Oct 27, 2017

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
How did your team break up the work to be done? Generally, ever morning we talked about the main task for the day and tried to break it up into smaller units.
How did your team utilize git to collaborate? We used branches, merged, and created pull requests.
What did your group do to try to keep your code DRY while many people collaborated on it? We used partials, helpers, and we discussed frequently and tried to figure out solutions for DRYing similar code.
What was a technical challenge that you faced as a group? The controller tests were challenging and using oauth with heroku. We partner programmed and talked through these issues.
What was a team/personal challenge that you faced as a group? We could have been better about using the Trello board consistently. However, we improved as the project went along.
What could your team have done better? We could have been better at testing and pacing ourselves.
What was your application's ERD? (include a link) It's on our trello boar, which is linked below.
What is your Trello URL? https://trello.com/b/o68ZXcQe/birdsy
What is the Heroku URL of your deployed application? https://birdsy.herokuapp.com/

@droberts-sea
Copy link

bEtsy

What We're Looking For

Feature Feedback
Baseline
Appropriate Git Usage with all members contributing yes
Answered comprehension questions yes
Trello board is created and utilized in project management yes
Heroku instance is online yes
General
Nested routes follow RESTful conventions mostly - see inline comment
oAuth used for User authentication yes
Functionality restricted based on user roles yes
Products can be added and removed from cart yes
Users can view past orders no (not a big deal)
Merchants can add, edit and view their products yes
Errors are reported to the user yes
Order Functionality
Reduces products' inventory some - Quantity was reduced, but couldn't make it go to 0. It looks like you have a validation on Product that stock must be greater than 0, so ordering the last one will cause the validation to fail and the stock won't update.
Cannot order products that are out of stock no - see above
Changes order state yes
Clears current cart yes
Database
ERD includes all necessary tables and relationships yes
Table relationships yes
Models
Validation rules for Models yes
Business logic is in the models Mostly yes! Just a few spots where it could be cleaned up - see inline comments.
Controllers
Controller Filters used to DRY up controller code yes
Testing
Model Testing yes
Controller Testing yes - good work
Session Testing yes
SimpleCov at 90% for controller and model tests yes
Front-end
The app is styled to create an attractive user interface yes - great work
The app layout uses Foundation's Grid yes
Content is organized with HTML5 semantic tags yes
CSS is DRY yes
Overall Great job overall! This site is attractive, well-organized and easy to navigate, and as far as I could tell everything works. Test coverage is solid, and I was not able to get away with any malicious behavior. As with any large project there are a few places where things could be cleaned up, and I've tried to point those out inline, but in general this is a very strong submission. You've clearly put in a ton of effort on the project, and it's paid off. Keep up the hard work!

IMPORTANT: Whoever submitted the PR (and thus will get the notification about this feedback) should share this with their teammates.

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title><%= content_for?(:title) ? yield(:title) : "Untitled" %></title>

Choose a reason for hiding this comment

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

This stuff in the <title> tag doesn't seem to have worked - the title of your page is always "Untitled".

resources :products, only: [:index]
end

resources :merchants do

Choose a reason for hiding this comment

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

All of these resources :merchants blocks could be consolidated.

Choose a reason for hiding this comment

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

Also, many of these routes only work for the currently logged in merchant. To me this implies that the merchant ID in the URL is redundant, and you could take this information from the session instead.

@order.order_items.each do |item|
@product = Product.find(item.product_id)
@product.stock -= item.quantity
@product.save

Choose a reason for hiding this comment

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

You should be checking the return value of .save here.

return false
else
return true
end

Choose a reason for hiding this comment

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

Because this method is used as a controller filter, you don't need the return here - in fact, the return value is never read. Just redirecting is enough to make sure the action won't be run.

def consoldate_order_items(order_id, product_id, quantity)
@order_items = OrderItem.where(order_id: order_id)
product_id = product_id.to_i
quantity = quantity.to_i

Choose a reason for hiding this comment

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

I like that you've separated this out into its own method!

This functionality might be a good candidate for a model method, perhaps an instance method on Order. You would have to rework the way you report status to the user a bit.

params[:order].each do |key, value|
if value == ""
flash[:status] = :failure
flash[:message] = "Any of required fields can't be empty"

Choose a reason for hiding this comment

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

This seems like a job for validations. Maybe a Payment needs to be a separate model, and an Order optionally has_one Payment.

flash[:message] = "Any of required fields can't be empty"
redirect_to edit_order_path(@order)
return
end

Choose a reason for hiding this comment

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

Instead of doing a redirect_to here you should use render, so that data the user has entered will stay in the form to get fixed.


describe CategoriesController do
describe "correct logged in user" do
before do

Choose a reason for hiding this comment

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

I very much like the pattern of splitting these tests into 3 sub-categories.

#Assert
#1. gave the order a cart
OrderItem.first.order_id.wont_equal nil
#2. set the session order id

Choose a reason for hiding this comment

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

Good organization

merchant: eva

two:
name: product2

Choose a reason for hiding this comment

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

Pro tip: you can use ERB in your fixture files!

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

Successfully merging this pull request may close these issues.

5 participants