Skip to content

Conversation

@karinnainiguez
Copy link

@karinnainiguez karinnainiguez commented Apr 27, 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
How did your team break up the work to be done? We worked on design as a group first. Testing for models and controllers was split up as evenly as possible to work individually. We shared screens and paired for things like oAuth, session, and the cart. We also did a lot of pair programming and debugging together after standups.
How did your team utilize git to collaborate? We branched off when working individually, and would wait to push to master until we were all ready and had discussed the changes that were made. That usually happened after standups.
What did your group do to try to keep your code DRY while many people collaborated on it? We created helper methods in the application controller that were used by multiple models. We also removed any controller methods that we felt were redundant or unnecessary.
What was a technical challenge that you faced as a group? After deployment we realized that browsers see http requests differently than https requests and that was preventing some people from logging in to our site from their computers.
What was a team/personal challenge that you faced as a group? Designing and creating a cart and what types of relationships would work as a "cart" was really difficult. We decided that instead of pairing or doing it individually, we would share screens among the four of us and talk together through it. It worked well, so we continued to do that with heroku issues that we faced.
What could your team have done better? We did a good job of testing before we started coding, but then abandoned our tests through the week. It was painful to go back and test existing code. Maybe we could have kept testing while we coded in TDD style to avoid the burnout.
What was your application's ERD? (include a link) https://www.lucidchart.com/documents/view/7f53f6ef-0162-40f1-b370-bf08fc593e0a/0
What is your Trello URL? https://trello.com/b/xQMD4GLc/petsy-feels
What is the Heroku URL of your deployed application? https://petsyfeels.herokuapp.com/

@karinnainiguez karinnainiguez changed the title pEtsy fEels - Angela, Cara, Dikla, Karinna - Octos Angela, Cara, Dikla, Karinna - pEtsy fEels - Octos Apr 27, 2018
@kariabancroft
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 - and it looks great. You had distinct tasks and it was clear to me how it was organized and assigned.
Heroku instance is online Yes
General
Nested routes follow RESTful conventions Yes
oAuth used for User authentication Yes
Functionality restricted based on user roles Yes - you require logging in. But it looks like you're not preventing users from editing other users products. So if I am logged in, I still shouldn't be able to edit another merchants products.
Products can be added and removed from cart Yes
Users can view past orders Yes - nice job with the functionality of the order dashboard
Merchants can add, edit and view their products Yes
Errors are reported to the user Yes - using models and flash messages throughout
Order Functionality
Reduces products' inventory Yes
Cannot order products that are out of stock Yes
Changes order state Yes
Clears current cart Yes
Database
ERD includes all necessary tables and relationships Yes
Table relationships Good
Models
Validation rules for Models Yes
Business logic is in the models Yes - though room for improvement based on the amount of logic in the views
Controllers
Controller Filters used to DRY up controller code Yes
Testing
Model Testing These tests look really good! You did a great job of coming up with many different scenarios and covering those.
Controller Testing You generally did a really nice job with controller tests as well. Nice job.
Session Testing Yes
SimpleCov at 90% for controller and model tests
Front-end
The app is styled to create an attractive user interface Yes
Content is organized with HTML5 semantic tags Yes
CSS is DRY Yes
Overall Overall, you did a nice job with this. I can tell that you really spent a lot of time working through testing your application. Your hard work shows. There are a few places where I'd like to see logic moved from views into the model to keep separation of concerns.

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

get '/cartitems', to: 'cartitems#index', as: 'cart'
delete '/cartitems/:id', to: 'cartitems#destroy', as: 'delete_cartitem'
patch '/cartitems/:id', to: 'cartitems#update', as: 'update_cartitem'
patch '/cartitems/ship/:id', to: 'cartitems#ship', as: 'ship'

Choose a reason for hiding this comment

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

The restful route would have the ID between the resource and the action - /cartitems/:id/ship

@@ -0,0 +1,69 @@
class ProductsController < ApplicationController
before_action :find_product, only: [:show, :edit, :update, :destroy, :retire]
before_action :require_login, except: [:index, :show]

Choose a reason for hiding this comment

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

Nice job using except here as the list gets long

t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.bigint "user_id"
t.string "product_status"

Choose a reason for hiding this comment

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

I would not choose product_status as a column on the products table - the extra "product" part of the column name is unnecessary


def index
if session[:order_id] == nil
order = Order.create!(state: 'pending')

Choose a reason for hiding this comment

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

I think that it is a good idea to create the order if it doesn't yet exist - but what if there is an issue here with creating the order?

else
@cart_item = Cartitem.new(cartitem_params)
# find the product from path
@cart_item.product = Product.find(params[:product_id])

Choose a reason for hiding this comment

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

What if the product isn't found?

quantity: 3
)

result = cart_item.valid?

Choose a reason for hiding this comment

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

Checking the validity of the item is not checking that it can be created. You still need to call .save or .create at some point.

Order.count.must_equal old_order_count


# with future date more than 5 years

Choose a reason for hiding this comment

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

These are all great test cases, and I'd recommend that they'd all be their own test. When trying to figure out if things should be their own test, I try to think: Is there more than one specific set of code that would need to change to fail this test? If so, it might be good to split it out.

@order.name.wont_equal @order_data[:name]


# without zipcode

Choose a reason for hiding this comment

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

This is the same fundamental test and with pieces of the data changed. Can you think of how you could consolidate to be able to use a loop rather than repeating the tests each time?

user_id: User.first.id
}
# Assumptions
product = Product.new(@product_data1)

Choose a reason for hiding this comment

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

This is a controller test that is never executing a controller action

@@ -0,0 +1,45 @@
require "test_helper"

describe ReviewsController do

Choose a reason for hiding this comment

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

It'd be good to check that a user can't review their own products

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.

5 participants