annotate .svn/pristine/2e/2e890aa88f7d83a47f036e36ee54bac43bb88fbe.svn-base @ 1524:82fac3dcf466 redmine-2.5-integration

Fix failure to interpret Javascript when autocompleting members for project
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Thu, 11 Sep 2014 10:24:38 +0100
parents cbb26bc654de
children
rev   line source
Chris@909 1 require 'rubygems'
Chris@909 2 require 'erb' # to get "h"
Chris@909 3 require 'active_support' # to get "returning"
Chris@909 4 require File.dirname(__FILE__) + '/../lib/gravatar'
Chris@909 5 include GravatarHelper, GravatarHelper::PublicMethods, ERB::Util
Chris@909 6
Chris@909 7 describe "gravatar_url with a custom default URL" do
Chris@909 8 before(:each) do
Chris@909 9 @original_options = DEFAULT_OPTIONS.dup
Chris@909 10 DEFAULT_OPTIONS[:default] = "no_avatar.png"
Chris@909 11 @url = gravatar_url("somewhere")
Chris@909 12 end
Chris@909 13
Chris@909 14 it "should include the \"default\" argument in the result" do
Chris@909 15 @url.should match(/&default=no_avatar.png/)
Chris@909 16 end
Chris@909 17
Chris@909 18 after(:each) do
Chris@909 19 DEFAULT_OPTIONS.merge!(@original_options)
Chris@909 20 end
Chris@909 21
Chris@909 22 end
Chris@909 23
Chris@909 24 describe "gravatar_url with default settings" do
Chris@909 25 before(:each) do
Chris@909 26 @url = gravatar_url("somewhere")
Chris@909 27 end
Chris@909 28
Chris@909 29 it "should have a nil default URL" do
Chris@909 30 DEFAULT_OPTIONS[:default].should be_nil
Chris@909 31 end
Chris@909 32
Chris@909 33 it "should not include the \"default\" argument in the result" do
Chris@909 34 @url.should_not match(/&default=/)
Chris@909 35 end
Chris@909 36
Chris@909 37 end
Chris@909 38
Chris@909 39 describe "gravatar with a custom title option" do
Chris@909 40 it "should include the title in the result" do
Chris@909 41 gravatar('example@example.com', :title => "This is a title attribute").should match(/This is a title attribute/)
Chris@909 42 end
Chris@909 43 end