Created
February 26, 2018 04:15
-
-
Save alanmaciel/93b3a8f2a00933dd9640b16ff5178c2f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe "Viewing a list of reviews" do | |
it "shows the reviews for a specific movie" do | |
movie1 = Movie.create(movie_attributes(title: "Iron Man")) | |
review1 = movie1.reviews.create(review_attributes(name: "Roger Ebert")) | |
review2 = movie1.reviews.create(review_attributes(name: "Gene Siskel")) | |
movie2 = Movie.create(movie_attributes(title: "Superman")) | |
review3 = movie2.reviews.create(review_attributes(name: "Peter Travers")) | |
visit movie_reviews_url(movie1) | |
expect(page).to have_text(review1.name) | |
expect(page).to have_text(review2.name) | |
expect(page).not_to have_text(review3.name) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment