mirror of
https://github.com/discourse/discourse.git
synced 2025-03-24 02:25:33 +08:00
add test case for topic status update based on last post
This commit is contained in:
parent
3d64f33d40
commit
5ff29ce321
@ -1138,6 +1138,13 @@ describe Topic do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'can take a number of hours as a string and can handle based on last post' do
|
||||||
|
Timecop.freeze(now) do
|
||||||
|
topic.set_or_create_status_update(TopicStatusUpdate.types[:close], '18', {by_user: admin, based_on_last_post: true})
|
||||||
|
expect(topic.topic_status_updates.first.execute_at).to eq(18.hours.from_now)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
it "can take a time later in the day" do
|
it "can take a time later in the day" do
|
||||||
Timecop.freeze(now) do
|
Timecop.freeze(now) do
|
||||||
topic.set_or_create_status_update(TopicStatusUpdate.types[:close], '13:00', {by_user: admin})
|
topic.set_or_create_status_update(TopicStatusUpdate.types[:close], '13:00', {by_user: admin})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user