0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-15 22:32:54 +01:00
discourse-custom-wizard/spec/requests/custom_wizard/admin/logs_controller_spec.rb

23 Zeilen
607 B
Ruby

require_relative '../../../plugin_helper'
2020-11-03 01:24:20 +01:00
describe CustomWizard::AdminLogsController do
fab!(:admin_user) { Fabricate(:user, admin: true) }
2021-02-24 08:50:42 +01:00
2020-11-03 01:24:20 +01:00
before do
CustomWizard::Log.create("First log message")
CustomWizard::Log.create("Second log message")
CustomWizard::Log.create("Third log message")
sign_in(admin_user)
end
it "returns a list of logs" do
get "/admin/wizards/logs.json"
expect(response.parsed_body.length).to eq(3)
end
2021-02-24 08:50:42 +01:00
2020-11-03 01:24:20 +01:00
it "paginates" do
get "/admin/wizards/logs.json", params: { page: 1, limit: 2 }
expect(response.parsed_body.length).to eq(1)
end
2021-02-24 08:50:42 +01:00
end