Sha256: 072e0ebbd6929cd2213443883d1ef13f909781f11761ae3971d726604ebc69f1

Contents?: true

Size: 842 Bytes

Versions: 2

Compression:

Stored size: 842 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

  it "checks the image basename" do
    @picture.basename.should == 'king.jpg'
  end

  it "checks the image extension" do
    @picture.type.downcase.should == 'jpg'
  end


end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
picturama-0.0.6 spec/picture_spec.rb
picturama-0.0.5 spec/picture_spec.rb