mirror of
https://github.com/danbee/danbarberphoto
synced 2025-03-04 08:49:07 +00:00
26 lines
577 B
Ruby
26 lines
577 B
Ruby
require 'spec_helper'
|
|
|
|
describe PhotosController do
|
|
describe "GET index" do
|
|
it "renders the index template" do
|
|
get :index
|
|
expect(response).to render_template(:index)
|
|
end
|
|
end
|
|
|
|
describe "GET log_view" do
|
|
let(:photo) { create(:photo) }
|
|
|
|
it "logs a photo view" do
|
|
Photo.any_instance.should_receive(:log_view).once
|
|
get :log_view, id: photo.id
|
|
should respond_with(:success)
|
|
end
|
|
|
|
it "responds with not_found if the photo isn't present" do
|
|
get :log_view, id: 999
|
|
should respond_with(:not_found)
|
|
end
|
|
end
|
|
end
|