ip addresses: fix exception on ip_addresses/show page.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user