forked from hoetmaaiers/url2png-gem
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
wout fierens
committed
Dec 1, 2011
1 parent
89bd1f9
commit d369b2c
Showing
4 changed files
with
75 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,38 @@ | ||
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') | ||
require File.expand_path(File.dirname(__FILE__) + '/../../lib/url2png/helpers/common.rb') | ||
require 'spec_helper' | ||
require 'url2png/helpers/common' | ||
|
||
describe Url2png do | ||
include Url2png::Helpers::Common | ||
before(:all) do | ||
Url2png::Config.public_key = "P4DBEC0200EE98" | ||
Url2png::Config.shared_secret = "S169B0E051EAC6794B3EC9F385866187R" | ||
end | ||
|
||
describe "site_image_tag" do | ||
it "should return the url of the http://pasparout.com image" do | ||
site_image_tag('http://pasparout.com').should_not be_nil | ||
end | ||
end | ||
|
||
describe "site_image_url" do | ||
it "should encode the thumbnail size when provided" do | ||
site_image_url('http://www.nytimes.com/', :thumbnail => '200x300').should =~ %r{t200x300} | ||
end | ||
|
||
it "should encode the initial browser size when provided" do | ||
site_image_url('http://www.nytimes.com/', :browser_size => '200x300').should =~ %r{s200x300} | ||
end | ||
|
||
it "should encode the delay when provided" do | ||
site_image_url('http://www.nytimes.com/', :delay => 3).should =~ %r{d3} | ||
end | ||
|
||
it "should encode the fullscreen capture flag when provided" do | ||
site_image_url('http://www.nytimes.com/', :fullscreen => true).should =~ %r{FULL} | ||
end | ||
|
||
it "should concatenate options by using hyphens" do | ||
site_image_url('http://www.nytimes.com/', :delay => 3, :fullscreen => true).should =~ %r{d3-FULL} | ||
end | ||
end | ||
end |