annotate vendor/plugins/gravatar/spec/.svn/text-base/gravatar_spec.rb.svn-base @ 0:513646585e45

* Import Redmine trunk SVN rev 3859
author Chris Cannam
date Fri, 23 Jul 2010 15:52:44 +0100
parents
children 40f7cfd4df19
rev   line source
Chris@0 1 require 'rubygems'
Chris@0 2 require 'erb' # to get "h"
Chris@0 3 require 'active_support' # to get "returning"
Chris@0 4 require File.dirname(__FILE__) + '/../lib/gravatar'
Chris@0 5 include GravatarHelper, GravatarHelper::PublicMethods, ERB::Util
Chris@0 6
Chris@0 7 context "gravatar_url with a custom default URL" do
Chris@0 8 setup do
Chris@0 9 @original_options = DEFAULT_OPTIONS.dup
Chris@0 10 DEFAULT_OPTIONS[:default] = "no_avatar.png"
Chris@0 11 @url = gravatar_url("somewhere")
Chris@0 12 end
Chris@0 13
Chris@0 14 specify "should include the \"default\" argument in the result" do
Chris@0 15 @url.should match(/&default=no_avatar.png/)
Chris@0 16 end
Chris@0 17
Chris@0 18 teardown do
Chris@0 19 DEFAULT_OPTIONS.merge!(@original_options)
Chris@0 20 end
Chris@0 21
Chris@0 22 end
Chris@0 23
Chris@0 24 context "gravatar_url with default settings" do
Chris@0 25 setup do
Chris@0 26 @url = gravatar_url("somewhere")
Chris@0 27 end
Chris@0 28
Chris@0 29 specify "should have a nil default URL" do
Chris@0 30 DEFAULT_OPTIONS[:default].should be_nil
Chris@0 31 end
Chris@0 32
Chris@0 33 specify "should not include the \"default\" argument in the result" do
Chris@0 34 @url.should_not match(/&default=/)
Chris@0 35 end
Chris@0 36
Chris@0 37 end