ip addresses: fix exception on ip_addresses/show page.

This commit is contained in:
evazion
2020-08-18 11:14:18 -05:00
parent fee68b6dd9
commit 4c3b4671ef
2 changed files with 3 additions and 3 deletions

View File

@@ -4,6 +4,6 @@ class IpAddressPolicy < ApplicationPolicy
end
def html_data_attributes
super & attributes.keys.map(&:to_sym)
super & record.attributes.keys.map(&:to_sym)
end
end

View File

@@ -43,12 +43,12 @@ class IpAddressesControllerTest < ActionDispatch::IntegrationTest
context "show action" do
should "be visible to mods" do
get_auth ip_address_path("1.1.1.1"), @mod
get_auth ip_address_path("1.2.3.4"), @mod
assert_response :success
end
should "not be visible to members" do
get_auth ip_address_path("1.1.1.1"), @user
get_auth ip_address_path("1.2.3.4"), @user
assert_response 403
end
end