Sha256: 25a088f87f37a0db9c77caaa30dc643dffde1f4b028761c747dceaf202490fc4

Contents?: true

Size: 1.71 KB

Versions: 19

Compression:

Stored size: 1.71 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 picture with default format" do
		p = show_picture_path(:id => 3, :size => "100x33", :name => 'kitten')
		p.should == "/alchemy/pictures/3/show/100x33/kitten.#{Alchemy::Config.get(:image_output_format)}"
	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

19 entries across 19 versions & 1 rubygems

Version Path
alchemy_cms-2.1.12 spec/helpers/url_helpers_spec.rb
alchemy_cms-2.1.11 spec/helpers/url_helpers_spec.rb
alchemy_cms-2.1.9.1 spec/helpers/url_helpers_spec.rb
alchemy_cms-2.1.9 spec/helpers/url_helpers_spec.rb
alchemy_cms-2.1.8.1 spec/helpers/url_helpers_spec.rb
alchemy_cms-2.1.8 spec/helpers/url_helpers_spec.rb
alchemy_cms-2.1.7 spec/helpers/url_helpers_spec.rb
alchemy_cms-2.1.6 spec/helpers/url_helpers_spec.rb
alchemy_cms-2.1.5 spec/helpers/url_helpers_spec.rb
alchemy_cms-2.1.4 spec/helpers/url_helpers_spec.rb
alchemy_cms-2.1.3 spec/helpers/url_helpers_spec.rb
alchemy_cms-2.1.2 spec/helpers/url_helpers_spec.rb
alchemy_cms-2.1.1 spec/helpers/url_helpers_spec.rb
alchemy_cms-2.1 spec/helpers/url_helpers_spec.rb
alchemy_cms-2.1.rc6 spec/helpers/url_helpers_spec.rb
alchemy_cms-2.1.rc5 spec/helpers/url_helpers_spec.rb
alchemy_cms-2.1.rc4 spec/helpers/url_helpers_spec.rb
alchemy_cms-2.1.rc3 spec/helpers/url_helpers_spec.rb
alchemy_cms-2.1.rc2 spec/helpers/url_helpers_spec.rb