This file contains hidden or 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 "Deleting a movie" do | |
| it "destroys the movie and shows the movie listing without the deleted movie" do | |
| movie = Movie.create(movie_attributes) | |
| visit movie_path(movie) | |
| click_link 'Delete' | |
This file contains hidden or 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 "Creating a new review" do | |
| it "saves the review" do | |
| movie = Movie.create(movie_attributes) | |
| visit movie_url(movie) | |
| click_link 'Write Review' |
This file contains hidden or 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_relative 'spec_helper' | |
| describe "Creating a new movie" do | |
| it "saves the movie and shows the new movie's details" do | |
| visit movies_url | |
| click_link 'Add New Movie' | |
| expect(current_path).to eq(new_movie_path) |
This file contains hidden or 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 "Creating a new review" do | |
| it "saves the review" do | |
| movie = Movie.create(movie_attributes) | |
| visit movie_url(movie) | |
| click_link 'Write Review' |
This file contains hidden or 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 UsersController do | |
| before do | |
| @user = User.create!(user_attributes) | |
| end | |
| context "when not signed in" do |
This file contains hidden or 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
| rails new -d=<postgresql|mysql|sqlite> --skip-test-unit <appname> |
This file contains hidden or 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
| /* | |
| * The Pragmatic Studio | |
| * http://pragmaticstudio.com | |
| * Copyright (c) 2011 The Pragmatic Studio | |
| * | |
| * Please don't use this exact layout and style | |
| * combination in your applications. | |
| */ |
This file contains hidden or 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
| module MoviesHelper | |
| def format_total_gross(movie) | |
| if movie.flop? | |
| content_tag(:strong, 'Flop!') | |
| else | |
| number_to_currency(movie.total_gross) | |
| end | |
| end | |
| def image_for(movie) |