From 6658c03d6652ec14a32d7f4de76a489fee98fcba Mon Sep 17 00:00:00 2001 From: Dan Barber Date: Thu, 29 Oct 2015 17:15:10 +0000 Subject: [PATCH] Fix most specs --- app/models/photo.rb | 4 ++-- spec/factories/photos.rb | 1 - spec/models/photo_spec.rb | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/models/photo.rb b/app/models/photo.rb index 26fa3ea..118057f 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -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 diff --git a/spec/factories/photos.rb b/spec/factories/photos.rb index fe60121..74d20c3 100644 --- a/spec/factories/photos.rb +++ b/spec/factories/photos.rb @@ -4,6 +4,5 @@ FactoryGirl.define do factory :photo do title 'A Photo' description 'A lovely photo of a tree' - image nil end end diff --git a/spec/models/photo_spec.rb b/spec/models/photo_spec.rb index b0d0128..5c6877e 100644 --- a/spec/models/photo_spec.rb +++ b/spec/models/photo_spec.rb @@ -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