Skip to content

Week 8 project at Makers Academy - Yelp clone made in Ruby on Rails. BDD with RSpec and Capybara.

Notifications You must be signed in to change notification settings

diaryofdiscoveries/yelpz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yelpz

Built a clone of Yelp in a week

Continuous Deployment via Heroku

https://yelpz-zoe.herokuapp.com/

Technologies used

  • Ruby on Rails
  • PostgreSQL

How to set up the application

$ git clone https://github.com/diaryofdiscoveries/yelpz.git
$ cd yelpz
$ bundle
$ psql
$ createdb yelpz_test
$ createdb yelpz_development
$ bin/rails db:migrate
$ rspec
$ bin/rails server

Tested using:

  • RSpec
  • Capybara

How to run tests

$ cd yelpz
$ rspec

Objectives of exercise

An introduction to Rails, focusing especially on:

  • Creating Rails applications
  • The structure of Rails apps (MVC, the router, helpers)
  • TDD in Rails, with RSpec & Capybara
  • Associations
  • Validations
  • AJAX in Rails

Version 1 - MVP

Duplicate the core functionality of Yelp - users should be presented with a list of restaurants which they can leave reviews for.

Drive the addition of all features using feature tests, and unit tests when needed.

V1 Specification

  • Visitors can create new restaurants using a form, specifying a name and description
  • Restaurants can be edited and deleted
  • Visitors can leave reviews for restaurants, providing a numerical score (1-5) and a comment about their experience
  • The restaurants listings page should display all the reviews, along with the average rating of each restaurant
  • Validations should be in place for the restaurant and review forms - restaurants must be given a name and rating, reviews must be given a rating from 1-5 (comment is optional)

Version 2 - User login

Although our initial version serves its purpose - it's limited in a few respects. Any visitor to the site can freely add, edit or delete. We also have very few options to track or constrain the visitors to our site.

We can solve both of these problems by adding a user login system, as we did with Bookmark Manager. This time though, you should use a popular gem - Devise - to accelarate the implementation of our user system.

V2 Specification

  • Users can register/login

  • Some indication should be given on the page (as part of the layout) whether the user is currently logged in, along with links to the available actions (i.e. Logout/Edit account is signed in, otherwise Sign In/Sign Up)

  • The email address of the reviewer should be displayed as part of the review

  • Optional - Users can't review a restaurant which they created

  • Optional - Users can log in through Facebook, Twitter, Github or another external service

Version 3 - Setting limits on users

Although our version 2 serves its purpose - it's limited in a few respects. First any user can freely create, delete or edit restaurants. Additionally, a user can leave multiple reviews for the same restaurant - making it easy for restaurant scores to be skewed.

V3 Specification

  • A user must be logged in to create restaurants
  • Users can only edit/delete restaurants which they've created
  • Users can only leave one review per restaurant
  • Users can delete their own reviews

Further challenges (OPTIONAL)

Finally, let's focus on uploading images, and creating a better user experience. This will introduce us to Amazon S3, Rails helper methods and using AJAX in conjunction with Rails.

Further specifications

  • Currently, when writing a review, we have to go to a separate page and trigger a page refresh. Migrate the functionality to happen asynchronously with AJAX. We'll also have to set up Poltergeist to enable us to run JS-enabled tests.
  • Create a helper method to allow ratings and average ratings to be displayed as stars (e.g.) rather than numbers
  • Use SCSS to enhance the overall design of the site
  • Refactor your more complex views to use partials
  • Add the ability for users to add an image to a restaurant

About

Week 8 project at Makers Academy - Yelp clone made in Ruby on Rails. BDD with RSpec and Capybara.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published