##// END OF EJS Templates
Merged r2302 from trunk (#2466)....
Merged r2302 from trunk (#2466). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.8-stable@2306 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r1960:ed314caf7d6e
r2304:5e6ff86f4736
Show More
gravatar_spec.rb
36 lines | 942 B | text/x-ruby | RubyLexer
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
context "gravatar_url with a custom default URL" do
setup do
@original_options = DEFAULT_OPTIONS.dup
DEFAULT_OPTIONS[:default] = "no_avatar.png"
@url = gravatar_url("somewhere")
end
specify "should include the \"default\" argument in the result" do
@url.should match(/&default=no_avatar.png/)
end
teardown do
DEFAULT_OPTIONS.merge!(@original_options)
end
end
context "gravatar_url with default settings" do
setup do
@url = gravatar_url("somewhere")
end
specify "should have a nil default URL" do
DEFAULT_OPTIONS[:default].should be_nil
end
specify "should not include the \"default\" argument in the result" do
@url.should_not match(/&default=/)
end
end