mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:11:08 +08:00
FIX: Actually error when topic timer time is in the past (#11434)
This commit is contained in:

committed by
GitHub

parent
b824af02d4
commit
9f786306bd
@ -2932,6 +2932,19 @@ RSpec.describe TopicsController do
|
||||
end
|
||||
end
|
||||
|
||||
context 'when time is in the past' do
|
||||
it 'returns an error' do
|
||||
freeze_time
|
||||
sign_in(admin)
|
||||
|
||||
post "/t/#{topic.id}/timer.json", params: {
|
||||
time: Time.current - 1.day,
|
||||
status_type: TopicTimer.types[1]
|
||||
}
|
||||
expect(response.status).to eq(400)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when logged in as an admin' do
|
||||
before do
|
||||
freeze_time
|
||||
|
Reference in New Issue
Block a user