mirror of
https://github.com/danbee/danbarberphoto
synced 2025-03-04 08:49:07 +00:00
Fix most specs
This commit is contained in:
parent
600458997b
commit
6658c03d66
@ -15,8 +15,8 @@ class Photo < ActiveRecord::Base
|
||||
title
|
||||
end
|
||||
|
||||
def image=(image_path)
|
||||
@image = CloudinaryImage.create(image_path)
|
||||
def image=(file_upload)
|
||||
@image = CloudinaryImage.create(file_upload)
|
||||
self.image_cloudinary_id = @image.id
|
||||
end
|
||||
|
||||
|
||||
@ -4,6 +4,5 @@ FactoryGirl.define do
|
||||
factory :photo do
|
||||
title 'A Photo'
|
||||
description 'A lovely photo of a tree'
|
||||
image nil
|
||||
end
|
||||
end
|
||||
|
||||
@ -3,8 +3,6 @@ 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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user