FEATURE: Rename Reset Read bulk action to Defer (#15972)

It is enabled only if defer is enabled in user options too and if the
button shows up in the topic's footer.
This commit is contained in:
Bianca Nenciu
2022-02-21 22:45:01 +02:00
committed by GitHub
parent 94883dd326
commit 90c3695ab0
8 changed files with 34 additions and 23 deletions

View File

@ -197,11 +197,18 @@ describe TopicsBulkAction do
end
end
describe "reset_read" do
describe "destroy_post_timing" do
fab!(:fist_post) { Fabricate(:post, topic: topic) }
before do
PostTiming.process_timings(topic.user, topic.id, 10, [[1, 10]])
end
it "delegates to PostTiming.destroy_for" do
tba = TopicsBulkAction.new(topic.user, [topic.id], type: 'reset_read')
PostTiming.expects(:destroy_for).with(topic.user_id, [topic.id])
topic_ids = tba.perform!
tba = TopicsBulkAction.new(topic.user, [topic.id], type: 'destroy_post_timing')
topic_ids = nil
expect { topic_ids = tba.perform! }.to change { PostTiming.count }.by(-1)
expect(topic_ids).to contain_exactly(topic.id)
end
end