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:
parent
694f791f93
commit
f5fb7426b9
@ -4,5 +4,6 @@ FactoryGirl.define do
|
|||||||
factory :photo do
|
factory :photo do
|
||||||
title "A Photo"
|
title "A Photo"
|
||||||
description "A lovely photo of a tree"
|
description "A lovely photo of a tree"
|
||||||
|
image Rails.root.join('spec/fixtures/photo.jpg')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
BIN
spec/fixtures/photo.jpg
vendored
Normal file
BIN
spec/fixtures/photo.jpg
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@ -3,6 +3,8 @@ require 'spec_helper'
|
|||||||
describe Photo do
|
describe Photo do
|
||||||
it { should have_and_belong_to_many(:categories) }
|
it { should have_and_belong_to_many(:categories) }
|
||||||
|
|
||||||
|
it { should validate_presence_of(:image) }
|
||||||
|
|
||||||
let(:photo) { create(:photo) }
|
let(:photo) { create(:photo) }
|
||||||
|
|
||||||
it "logs a view" do
|
it "logs a view" do
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user