get all unit tests running again. Seems we have some pretty old code in there :-)

This commit is contained in:
Reinier Balt 2012-04-17 16:47:37 +02:00
parent e964769553
commit fd4fb6df9e
19 changed files with 255 additions and 284 deletions

View file

@ -11,3 +11,46 @@ class ActiveSupport::TestCase
# Add more helper methods to be used by all tests here...
end
module Tracks
class Config
def self.salt
"change-me"
end
def self.auth_schemes
return ["database","open_id"]
end
end
end
class ActiveSupport::TestCase
# Generates a random string of ascii characters (a-z, "1 0")
# of a given length for testing assignment to fields
# for validation purposes
#
def generate_random_string(length)
string = ""
characters = %w(a b c d e f g h i j k l m n o p q r s t u v w z y z 1\ 0)
length.times do
pick = characters[rand(26)]
string << pick
end
return string
end
def assert_equal_dmy(date1, date2)
assert_equal date1.strftime("%d-%m-%y"), date2.strftime("%d-%m-%y")
end
end
class Test::Unit::TestCase
def assert_value_changed(object, method = nil)
initial_value = object.send(method)
yield
assert_not_equal initial_value, object.send(method), "#{object}##{method}"
end
end