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

Add image fixture and validation.

This commit is contained in:
Dan Barber 2014-03-07 16:00:03 +00:00
parent 694f791f93
commit f5fb7426b9
3 changed files with 3 additions and 0 deletions

View File

@ -4,5 +4,6 @@ FactoryGirl.define do
factory :photo do
title "A Photo"
description "A lovely photo of a tree"
image Rails.root.join('spec/fixtures/photo.jpg')
end
end

BIN
spec/fixtures/photo.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -3,6 +3,8 @@ require 'spec_helper'
describe Photo do
it { should have_and_belong_to_many(:categories) }
it { should validate_presence_of(:image) }
let(:photo) { create(:photo) }
it "logs a view" do