mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 21:25:24 +08:00
FEATURE: Make staff action logs page support infinite loading
This commit is contained in:
@ -31,6 +31,26 @@ describe Admin::StaffActionLogsController do
|
||||
)
|
||||
end
|
||||
|
||||
it 'generates logs with pages' do
|
||||
1.upto(4).each do |idx|
|
||||
StaffActionLogger.new(Discourse.system_user).log_site_setting_change("title", "value #{idx - 1}", "value #{idx}")
|
||||
end
|
||||
|
||||
get "/admin/logs/staff_action_logs.json", params: { limit: 3 }
|
||||
|
||||
json = JSON.parse(response.body)
|
||||
expect(response.status).to eq(200)
|
||||
expect(json["staff_action_logs"].length).to eq(3)
|
||||
expect(json["staff_action_logs"][0]["new_value"]).to eq("value 4")
|
||||
|
||||
get "/admin/logs/staff_action_logs.json", params: { limit: 3, page: 1 }
|
||||
|
||||
json = JSON.parse(response.body)
|
||||
expect(response.status).to eq(200)
|
||||
expect(json["staff_action_logs"].length).to eq(1)
|
||||
expect(json["staff_action_logs"][0]["new_value"]).to eq("value 1")
|
||||
end
|
||||
|
||||
context 'When staff actions are extended' do
|
||||
let(:plugin_extended_action) { :confirmed_ham }
|
||||
before { UserHistory.stubs(:staff_actions).returns([plugin_extended_action]) }
|
||||
|
Reference in New Issue
Block a user