ip addresses: fix exception on ip_addresses/show page.
This commit is contained in:
@@ -4,6 +4,6 @@ class IpAddressPolicy < ApplicationPolicy
|
|||||||
end
|
end
|
||||||
|
|
||||||
def html_data_attributes
|
def html_data_attributes
|
||||||
super & attributes.keys.map(&:to_sym)
|
super & record.attributes.keys.map(&:to_sym)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -43,12 +43,12 @@ class IpAddressesControllerTest < ActionDispatch::IntegrationTest
|
|||||||
|
|
||||||
context "show action" do
|
context "show action" do
|
||||||
should "be visible to mods" 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
|
assert_response :success
|
||||||
end
|
end
|
||||||
|
|
||||||
should "not be visible to members" do
|
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
|
assert_response 403
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user