Mercurial > hg > soundsoftware-site
diff .svn/pristine/2e/2e890aa88f7d83a47f036e36ee54bac43bb88fbe.svn-base @ 909:cbb26bc654de redmine-1.3
Update to Redmine 1.3-stable branch (Redmine SVN rev 8964)
author | Chris Cannam |
---|---|
date | Fri, 24 Feb 2012 19:09:32 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.svn/pristine/2e/2e890aa88f7d83a47f036e36ee54bac43bb88fbe.svn-base Fri Feb 24 19:09:32 2012 +0000 @@ -0,0 +1,43 @@ +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 + +describe "gravatar_url with a custom default URL" do + before(:each) do + @original_options = DEFAULT_OPTIONS.dup + DEFAULT_OPTIONS[:default] = "no_avatar.png" + @url = gravatar_url("somewhere") + end + + it "should include the \"default\" argument in the result" do + @url.should match(/&default=no_avatar.png/) + end + + after(:each) do + DEFAULT_OPTIONS.merge!(@original_options) + end + +end + +describe "gravatar_url with default settings" do + before(:each) do + @url = gravatar_url("somewhere") + end + + it "should have a nil default URL" do + DEFAULT_OPTIONS[:default].should be_nil + end + + it "should not include the \"default\" argument in the result" do + @url.should_not match(/&default=/) + end + +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