Skip to content

Commit

Permalink
Fixed arrays/strings being treated interchangably in tests (caused te…
Browse files Browse the repository at this point in the history
…st failures in Ruby 1.9)
  • Loading branch information
jferris committed Jan 17, 2011
1 parent 53169b1 commit a3cced5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/models/clearance_mailer_test.rb
Expand Up @@ -19,7 +19,7 @@ class ClearanceMailerTest < ActiveSupport::TestCase
should "contain a link to edit the user's password" do
host = ActionMailer::Base.default_url_options[:host]
regexp = %r{http://#{host}/users/#{@user.id}/password/edit\?token=#{@user.confirmation_token}}
assert_match regexp, @email.body
assert_match regexp, @email.body.to_s
end

should "set its subject" do
Expand Down
1 change: 1 addition & 0 deletions test/test_helper.rb
Expand Up @@ -31,6 +31,7 @@ def self.should_set_cookie(name, value, should_expire_at)
# cookies and @response[cookies] don't give us the expire time, so we need to fish it out 'manually'
set_cookie_headers = @response.headers['Set-Cookie']
assert_not_nil set_cookie_headers, "@response.headers['Set-Cookie'] must not be nil"
set_cookie_headers = [set_cookie_headers] if set_cookie_headers.respond_to?(:to_str)
regex = /^#{name}=#{value}(;|$)/
assert_contains set_cookie_headers, regex
cookie = set_cookie_headers.find {|h| h =~ regex}
Expand Down

0 comments on commit a3cced5

Please sign in to comment.