Add deactivates_at date to user blocks
Block deactivation dates that take needs_view-block views into account were derived using updated_at. This was possible because inactive blocks couldn't be edited and their updated_at date wouldn't change. With editing of inactive blocks enabled deactivation date needs to be saved explicitly.
This commit is contained in:
parent
41b81bd393
commit
cff4c63713
8 changed files with 165 additions and 15 deletions
|
@ -15,7 +15,8 @@ class UserBlocksTest < ActionDispatch::IntegrationTest
|
|||
:user_id => blocked_user.id,
|
||||
:creator_id => create(:moderator_user).id,
|
||||
:reason => "testing",
|
||||
:ends_at => Time.now.utc + 5.minutes
|
||||
:ends_at => Time.now.utc + 5.minutes,
|
||||
:deactivates_at => Time.now.utc + 5.minutes
|
||||
)
|
||||
get "/api/#{Settings.api_version}/user/details", :headers => basic_authorization_header(blocked_user.display_name, "test")
|
||||
assert_response :forbidden
|
||||
|
@ -29,7 +30,8 @@ class UserBlocksTest < ActionDispatch::IntegrationTest
|
|||
:user_id => blocked_user.id,
|
||||
:creator_id => moderator.id,
|
||||
:reason => "testing",
|
||||
:ends_at => Time.now.utc + 5.minutes
|
||||
:ends_at => Time.now.utc + 5.minutes,
|
||||
:deactivates_at => Time.now.utc + 5.minutes
|
||||
)
|
||||
get "/api/#{Settings.api_version}/user/details", :headers => basic_authorization_header(blocked_user.display_name, "test")
|
||||
assert_response :forbidden
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue