Skip to content

Instantly share code, notes, and snippets.

@alanmaciel
Created February 26, 2018 04:15
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 alanmaciel/93b3a8f2a00933dd9640b16ff5178c2f to your computer and use it in GitHub Desktop.
Save alanmaciel/93b3a8f2a00933dd9640b16ff5178c2f to your computer and use it in GitHub Desktop.
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