Sha256: 67c1a882561a35f7b6fa45214dba894fbc000ea139a5ba666023c6e427188072

Contents?: true

Size: 1.51 KB

Versions: 37

Compression:

Stored size: 1.51 KB

Contents

require 'spec_helper'

describe "URL generating" do

  it "should generate a url string for cropped picture" do
    p = show_picture_path(:id => 3, :crop => "crop", :size => "100x33", :name => "kitten", :format => "jpg")
    p.should == "/alchemy/pictures/3/show/100x33/crop/kitten.jpg"
  end

  it "should generate a url string for cropped and masked picture" do
    p = show_picture_path(:id => 3, :crop => "crop", :crop_from => "0x0", :crop_size => "900x300", :size => "100x33", :name => "kitten", :format => :jpg)
    p.should == "/alchemy/pictures/3/show/100x33/crop/0x0/900x300/kitten.jpg"
  end

  it "should generate a url string for cropped thumbnail" do
    p = thumbnail_path(:id => 3, :crop => "crop", :size => "100x33", :name => "kitten", :format => :jpg)
    p.should == "/alchemy/pictures/3/thumbnails/100x33/crop/kitten.jpg"
  end

  it "should generate a url string for thumbnail with default name and format" do
    p = thumbnail_path(:id => 3, :size => "100x33")
    p.should == "/alchemy/pictures/3/thumbnails/100x33/thumbnail.png"
  end

  it "should generate a url string for cropped and masked thumbnail" do
    p = thumbnail_path(:id => 3, :crop_from => "0x0", :crop_size => "900x300", :size => "100x33", :name => "kitten", :format => :jpg)
    p.should == "/alchemy/pictures/3/thumbnails/100x33/0x0/900x300/kitten.jpg"
  end

  it "should generate a url string for zoomed image" do
    p = zoom_picture_path(:id => 3, :name => "kitten", :format => :jpg)
    p.should == "/alchemy/pictures/3/zoom/kitten.jpg"
  end

end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
alchemy_cms-2.5.3.1 spec/url_helpers_spec.rb
alchemy_cms-2.5.3 spec/url_helpers_spec.rb
alchemy_cms-2.5.2.2 spec/url_helpers_spec.rb
alchemy_cms-2.5.2.1 spec/url_helpers_spec.rb
alchemy_cms-2.5.2 spec/url_helpers_spec.rb
alchemy_cms-2.5.1 spec/url_helpers_spec.rb
alchemy_cms-2.5.0 spec/url_helpers_spec.rb
alchemy_cms-2.5.0.rc3 spec/url_helpers_spec.rb
alchemy_cms-2.5.0.b9 spec/url_helpers_spec.rb
alchemy_cms-2.3.2 spec/url_helpers_spec.rb
alchemy_cms-2.2.4 spec/helpers/url_helpers_spec.rb
alchemy_cms-2.4.1 spec/url_helpers_spec.rb
alchemy_cms-2.5.0.b5 spec/url_helpers_spec.rb
alchemy_cms-2.5.0.b2 spec/url_helpers_spec.rb
alchemy_cms-2.4.0 spec/url_helpers_spec.rb
alchemy_cms-2.4.rc4 spec/url_helpers_spec.rb
alchemy_cms-2.4.rc2 spec/url_helpers_spec.rb
alchemy_cms-2.4.rc1 spec/url_helpers_spec.rb
alchemy_cms-2.3.1 spec/url_helpers_spec.rb
alchemy_cms-2.4.beta2 spec/url_helpers_spec.rb