kanbanworkflowstimelinescrumrubyroadmapproject-planningproject-managementopenprojectangularissue-trackerifcgantt-chartganttbug-trackerboardsbcf
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.2 KiB
45 lines
1.2 KiB
13 years ago
|
#-- encoding: UTF-8
|
||
16 years ago
|
require 'rubygems'
|
||
|
require 'erb' # to get "h"
|
||
|
require 'active_support' # to get "returning"
|
||
|
require File.dirname(__FILE__) + '/../lib/gravatar'
|
||
|
include GravatarHelper, GravatarHelper::PublicMethods, ERB::Util
|
||
|
|
||
14 years ago
|
describe "gravatar_url with a custom default URL" do
|
||
|
before(:each) do
|
||
16 years ago
|
@original_options = DEFAULT_OPTIONS.dup
|
||
|
DEFAULT_OPTIONS[:default] = "no_avatar.png"
|
||
|
@url = gravatar_url("somewhere")
|
||
|
end
|
||
|
|
||
14 years ago
|
it "should include the \"default\" argument in the result" do
|
||
16 years ago
|
@url.should match(/&default=no_avatar.png/)
|
||
|
end
|
||
|
|
||
14 years ago
|
after(:each) do
|
||
16 years ago
|
DEFAULT_OPTIONS.merge!(@original_options)
|
||
|
end
|
||
|
|
||
|
end
|
||
|
|
||
14 years ago
|
describe "gravatar_url with default settings" do
|
||
|
before(:each) do
|
||
16 years ago
|
@url = gravatar_url("somewhere")
|
||
|
end
|
||
|
|
||
14 years ago
|
it "should have a nil default URL" do
|
||
16 years ago
|
DEFAULT_OPTIONS[:default].should be_nil
|
||
|
end
|
||
|
|
||
14 years ago
|
it "should not include the \"default\" argument in the result" do
|
||
16 years ago
|
@url.should_not match(/&default=/)
|
||
|
end
|
||
|
|
||
14 years ago
|
end
|
||
|
|
||
|
describe "gravatar with a custom title option" do
|
||
|
it "should include the title in the result" do
|
||
|
gravatar('example@example.com', :title => "This is a title attribute").should match(/This is a title attribute/)
|
||
|
end
|
||
|
end
|