micro-blogger/test/policies/application_policy_test.rb
2018-11-10 20:34:11 -06:00

19 lines
626 B
Ruby

# frozen_string_literal: true
require 'test_helper'
class ApplicationPolicyTest < PolicyAssertions::Test
# Verify default policies are most restrictive
test 'should not permit by default' do
admin = users(:admin)
assert_not ApplicationPolicy.new(admin, nil).show?
assert_not ApplicationPolicy.new(admin, nil).index?
assert_not ApplicationPolicy.new(admin, nil).create?
assert_not ApplicationPolicy.new(admin, nil).new?
assert_not ApplicationPolicy.new(admin, nil).update?
assert_not ApplicationPolicy.new(admin, nil).edit?
assert_not ApplicationPolicy.new(admin, nil).destroy?
end
end