Sha256: 0fdef73e24e501f9f9c26e73b898beb2ec0033c0f11bdf055a02b47b5dc97461
Contents?: true
Size: 682 Bytes
Versions: 14
Compression:
Stored size: 682 Bytes
Contents
require 'test_helper' class RolesWithCustomAssociationNamesTest < ActiveSupport::TestCase setup do Access.destroy_all [Account, FooBar].each { |model| model.delete_all } assert @subj = Account.create! assert @subj2 = Account.create! assert @foobar = FooBar.create! end test "should basically work" do assert_difference -> { Access.count }, 2 do assert @subj.has_role! :admin assert @subj.has_role! :user, @foobar end assert @subj.has_role? :admin refute @subj2.has_role? :admin assert @subj.has_role? :user, @foobar refute @subj2.has_role? :user, @foobar @subj.has_no_roles! @subj2.has_no_roles! end end
Version data entries
14 entries across 14 versions & 2 rubygems