Sha256: ab0ec0278223936aaad6d3409d3c405103cf82dfa42f1d61d7a8a910dbe69301

Contents?: true

Size: 669 Bytes

Versions: 2

Compression:

Stored size: 669 Bytes

Contents

require 'mini_magick'
require_relative 'spec_helper'

describe "For a given picture in a given album" do 
  
  before :each do
    @target_exists_folder = "#{Dir.pwd}/spec/pictures"
    album = Picturama::Album.new(:folder => @target_exists_folder)
    album.init_thumbnails
    @picture = album.pictures.first
    @thumb_w = 100
  end

  it "generate thumbnail" do
    @picture.has_thumbnail?.should be_false
    thumb = MiniMagick::Image.open(@picture.path)
    thumb.resize "100x100"
    thumb.format "jpg"
    thumb.write @picture.thumbnail
    @picture.has_thumbnail?.should be_true
    @picture.remove_assoc
    @picture.has_thumbnail?.should be_false
  end


end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
picturama-0.0.3 spec/picture_spec.rb
picturama-0.0.2 spec/picture_spec.rb