Sha256: 1677832cf1e45795d59b7390d42df01cc170930a48e0eb60647b06ea6c2a44e3
Contents?: true
Size: 778 Bytes
Versions: 97
Compression:
Stored size: 778 Bytes
Contents
require File.dirname(__FILE__) + '/../test_helper' class PermissionTest < Test::Unit::TestCase include Goldberg::TestHelper def test_invalid_without_name permission = Goldberg::Permission.new assert(!permission.valid?) assert(permission.errors.invalid?(:name)) assert(!permission.save) end def test_uniqueness_of_name name_1 = 'THIS_IS_NAME_1' name_2 = 'THIS_IS_NAME_2' name_1.freeze name_2.freeze permission_1 = Goldberg::Permission.new permission_2 = Goldberg::Permission.new permission_1.name = name_1 permission_2.name = name_2 assert(permission_1.save) assert(permission_2.save) permission_2.name = name_1 assert(!permission_2.save) assert(permission_2.errors.invalid?(:name)) end end
Version data entries
97 entries across 97 versions & 2 rubygems