Skip to content

Instantly share code, notes, and snippets.

@hoitomt
Forked from colinrymer/gist:5798469
Last active December 18, 2015 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoitomt/5798684 to your computer and use it in GitHub Desktop.
Save hoitomt/5798684 to your computer and use it in GitHub Desktop.

Product management has come up with the idea of allowing website users to leave reviews and ratings for listings. This feedback will be entered similar to how leads are submitted, but the user must enter the following information:

  • name
  • email address
  • phone number
  • rating from 1 to 5
  • optional review

In addition to the above information, a CAPTCHA presenting three different apartment complexes (only one of which is correct) is used in conjunction with the user’s name and phone number to determine whether or not the user actually lived at the listing. After validating and verifying the information, the user gets redirected to a thank you page. After a review is successfully submitted, it will show up as the first entry in the reviews for the listing. Pre-existing “certified resident” reviews will be integrated along with reviews that are submitted through the site. On the search results page, users can sort on rating type or filter on review type and rating. A link on each listing will take the user to the review area, which is presented as the sixth tab on the listing’s details page.

Cucumber

Feature: Ratings and Reviews
  As a User, 
  In order to rate a listing
  I should be able to leave a review for a listing
    
  Scenario: Successfully submit the review
  Given a Ratings and Review form for a Listing
  When the form is submitted with valid information
  Then the browser should be redirected to the R&R Thank You page
  And the ratings count should be incremented by 1 for the listing
    
  Scenario: Invalid Captcha
  Given a Ratings and Review form for a listing
  When the form is submitted with an invalid User Verification
  Then the browser should remain on the current Listing form
  and the ratings count should not be incremented for the listing
  and an error message should be displayed to the user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment