Sha256: 9bf6f337f3059660c226c2f531b289280f4b3967e7a3f10b982b7b4fb2c279da
Contents?: true
Size: 1.22 KB
Versions: 19
Compression:
Stored size: 1.22 KB
Contents
require File.dirname(__FILE__) + '/test_helper' module FriendlyId module Test module ActiveRecord2 module Simple module SimpleTest def klass @klass ||= User end def instance @instance ||= User.create! :name => "hello world" end def other_class Author end end class StatusTest < ::Test::Unit::TestCase include SimpleTest test "should default to not friendly" do assert !status.friendly? end test "should default to numeric" do assert status.numeric? end test "should be friendly if name is set" do status.name = "name" assert status.friendly? end test "should be best if it is numeric, but record has no friendly_id" do instance.send("#{klass.friendly_id_config.column}=", nil) assert status.best? end def status @status ||= instance.friendly_id_status end end class BasicTest < ::Test::Unit::TestCase include Core include SimpleTest end end end end end
Version data entries
19 entries across 19 versions & 2 rubygems