From 8f476a49930fb0548a80512609ed38413c800250 Mon Sep 17 00:00:00 2001 From: Martin Emde Date: Sat, 31 Aug 2024 14:22:13 -0700 Subject: [PATCH] Add a policy test --- test/policies/rubygem_policy_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/policies/rubygem_policy_test.rb b/test/policies/rubygem_policy_test.rb index c5cefe7a214..0b6f08bf9ad 100644 --- a/test/policies/rubygem_policy_test.rb +++ b/test/policies/rubygem_policy_test.rb @@ -95,4 +95,12 @@ def policy!(user) refute_authorized nil, :show_unconfirmed_ownerships? end end + + context "#show_owner_mfa_status?" do + should "only allow the owner" do + assert_authorized @owner, :show_owner_mfa_status? + refute_authorized @user, :show_owner_mfa_status? + refute_authorized nil, :show_owner_mfa_status? + end + end end