This commit is contained in:
Gopesh Tulsyan 2014-06-11 10:18:52 +00:00
commit 6903a0b7c1
11 changed files with 115 additions and 12 deletions

12
spec/factories/photos.rb Normal file
View file

@ -0,0 +1,12 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :photo do
picture_file_name 'rails.png'
picture_content_type 'image/png'
picture_file_size '1024'
picture_updated_at DateTime.now
description 'Lorem Ipsum Dolor'
conference
end
end

14
spec/models/photo_spec.rb Normal file
View file

@ -0,0 +1,14 @@
require 'spec_helper'
describe Photo do
describe 'validations' do
it 'has a valid factory' do
expect(build(:photo)).to be_valid
end
it 'is not valid without a picture' do
should validate_presence_of(:picture)
end
end
end