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'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe ContactsController do
|
describe ContactsController, type: :controller do
|
||||||
describe "GET new" do
|
describe "GET new" do
|
||||||
it "renders the contact form" do
|
it "renders the contact form" do
|
||||||
get :new
|
get :new
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe HomeController do
|
describe HomeController, type: :controller do
|
||||||
describe "GET index" do
|
describe "GET index" do
|
||||||
it "renders the index template" do
|
it "renders the index template" do
|
||||||
get :index
|
get :index
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe PagesController do
|
describe PagesController, type: :controller do
|
||||||
describe "GET show" do
|
describe "GET show" do
|
||||||
let(:test_page) { create(:page) }
|
let(:test_page) { create(:page) }
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe PhotosController do
|
describe PhotosController, type: :controller do
|
||||||
describe "GET index" do
|
describe "GET index" do
|
||||||
it "renders the index template" do
|
it "renders the index template" do
|
||||||
get :index
|
get :index
|
||||||
@ -12,14 +12,14 @@ describe PhotosController do
|
|||||||
let(:photo) { create(:photo) }
|
let(:photo) { create(:photo) }
|
||||||
|
|
||||||
it "logs a photo view" do
|
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
|
get :log_view, id: photo.id
|
||||||
should respond_with(:success)
|
expect(response).to be_successful
|
||||||
end
|
end
|
||||||
|
|
||||||
it "responds with not_found if the photo isn't present" do
|
it "responds with not_found if the photo isn't present" do
|
||||||
get :log_view, id: 999
|
get :log_view, id: 999
|
||||||
should respond_with(:not_found)
|
expect(response.status).to eql(404)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
ENV["RAILS_ENV"] ||= 'test'
|
ENV["RAILS_ENV"] ||= 'test'
|
||||||
require File.expand_path("../../config/environment", __FILE__)
|
require File.expand_path("../../config/environment", __FILE__)
|
||||||
require 'rspec/rails'
|
require 'rspec/rails'
|
||||||
require 'rspec/autorun'
|
|
||||||
require 'capybara/rspec'
|
require 'capybara/rspec'
|
||||||
require 'capybara/poltergeist'
|
require 'capybara/poltergeist'
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user