mirror of
https://github.com/danbee/danbarberphoto
synced 2025-03-04 08:49:07 +00:00
Fix controller specs.
This commit is contained in:
parent
45202dad6f
commit
086e66752a
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe PagesController do
|
||||
describe PagesController, type: :controller do
|
||||
describe "GET show" do
|
||||
let(:test_page) { create(:page) }
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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'
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user