diff --git a/app/policies/ip_address_policy.rb b/app/policies/ip_address_policy.rb index fecd6dd23..209ccb541 100644 --- a/app/policies/ip_address_policy.rb +++ b/app/policies/ip_address_policy.rb @@ -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 diff --git a/test/functional/ip_addresses_controller_test.rb b/test/functional/ip_addresses_controller_test.rb index b4c212e50..ad98fd5d3 100644 --- a/test/functional/ip_addresses_controller_test.rb +++ b/test/functional/ip_addresses_controller_test.rb @@ -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