Skip to content
Snippets Groups Projects
Commit e34e1cb6 authored by Taico Aerts's avatar Taico Aerts
Browse files

Add test for expiring lock

parent f042be4b
Branches
Tags
2 merge requests!51Upgrade to latest qpixel,!50Update to latest codidact changes
......@@ -79,4 +79,15 @@ class PostsControllerTest < ActionController::TestCase
end
assert_equal 'success', JSON.parse(response.body)['status']
end
test 'Locks on posts expire' do
sign_in users(:moderator)
post :lock, params: { id: posts(:question_one).id, length: 1, format: :json }
assert_response 200
# Change the locked_until to have already passed
assigns(:post).update(locked_until: 1.second.ago)
assert_not assigns(:post).locked?
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment