1
0
mirror of https://github.com/danbee/danbarberphoto synced 2025-03-04 08:49:07 +00:00

Fix controller specs.

This commit is contained in:
Dan Barber 2014-12-09 11:14:22 +00:00
parent 45202dad6f
commit 086e66752a
5 changed files with 7 additions and 8 deletions

View File

@ -1,6 +1,6 @@
require 'spec_helper'
describe ContactsController do
describe ContactsController, type: :controller do
describe "GET new" do
it "renders the contact form" do
get :new

View File

@ -1,6 +1,6 @@
require 'spec_helper'
describe HomeController do
describe HomeController, type: :controller do
describe "GET index" do
it "renders the index template" do
get :index

View File

@ -1,6 +1,6 @@
require 'spec_helper'
describe PagesController do
describe PagesController, type: :controller do
describe "GET show" do
let(:test_page) { create(:page) }

View File

@ -1,6 +1,6 @@
require 'spec_helper'
describe PhotosController do
describe PhotosController, type: :controller do
describe "GET index" do
it "renders the index template" do
get :index
@ -12,14 +12,14 @@ describe PhotosController do
let(:photo) { create(:photo) }
it "logs a photo view" do
Photo.any_instance.should_receive(:log_view).once
expect_any_instance_of(Photo).to receive(:log_view).once
get :log_view, id: photo.id
should respond_with(:success)
expect(response).to be_successful
end
it "responds with not_found if the photo isn't present" do
get :log_view, id: 999
should respond_with(:not_found)
expect(response.status).to eql(404)
end
end
end

View File

@ -2,7 +2,6 @@
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
require 'capybara/rspec'
require 'capybara/poltergeist'