Mercurial > hg > soundsoftware-site
comparison .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 |
comparison
equal
deleted
inserted
replaced
908:c6c2cbd0afee | 909:cbb26bc654de |
---|---|
1 require 'rubygems' | |
2 require 'erb' # to get "h" | |
3 require 'active_support' # to get "returning" | |
4 require File.dirname(__FILE__) + '/../lib/gravatar' | |
5 include GravatarHelper, GravatarHelper::PublicMethods, ERB::Util | |
6 | |
7 describe "gravatar_url with a custom default URL" do | |
8 before(:each) do | |
9 @original_options = DEFAULT_OPTIONS.dup | |
10 DEFAULT_OPTIONS[:default] = "no_avatar.png" | |
11 @url = gravatar_url("somewhere") | |
12 end | |
13 | |
14 it "should include the \"default\" argument in the result" do | |
15 @url.should match(/&default=no_avatar.png/) | |
16 end | |
17 | |
18 after(:each) do | |
19 DEFAULT_OPTIONS.merge!(@original_options) | |
20 end | |
21 | |
22 end | |
23 | |
24 describe "gravatar_url with default settings" do | |
25 before(:each) do | |
26 @url = gravatar_url("somewhere") | |
27 end | |
28 | |
29 it "should have a nil default URL" do | |
30 DEFAULT_OPTIONS[:default].should be_nil | |
31 end | |
32 | |
33 it "should not include the \"default\" argument in the result" do | |
34 @url.should_not match(/&default=/) | |
35 end | |
36 | |
37 end | |
38 | |
39 describe "gravatar with a custom title option" do | |
40 it "should include the title in the result" do | |
41 gravatar('example@example.com', :title => "This is a title attribute").should match(/This is a title attribute/) | |
42 end | |
43 end |