Sha256: 99ed8d2be0ea7b78fec7d3039e2986ba7023d24593ede7e45dc79de360c2f3bb
Contents?: true
Size: 887 Bytes
Versions: 10
Compression:
Stored size: 887 Bytes
Contents
require 'test_helper' require 'editor/test_helper' class ImageTest < ActiveSupport::TestCase Struct.new('File', :original_filename) test 'should only return favorited images' do Image.favorites.each do |image| assert image.favorite?, 'Image should be favorited' end end test 'path should handle blank base_folder' do Rails.application.secrets.s3['path'] = "" file = Struct::File.new('some_image.jpg') image = Admin::Image.new image.post = Admin::Post.first assert_equal image.send(:path, file), "#{image.post.id}/some_image.jpg" end test 'path should handle base_folder' do Rails.application.secrets.s3['path'] = "my_blog" file = Struct::File.new('some_image.jpg') image = Admin::Image.new image.post = Admin::Post.first assert_equal image.send(:path, file), "my_blog/#{image.post.id}/some_image.jpg" end end
Version data entries
10 entries across 10 versions & 1 rubygems