micro-blogger/test/policies/application_policy_test.rb

19 lines
626 B
Ruby
Raw Permalink Normal View History

2018-11-10 18:46:47 -06:00
# 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