mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 20:11:11 +08:00
Rename CsvExportLog to UserExport
This commit is contained in:
@ -22,11 +22,11 @@ describe ExportCsvController do
|
||||
|
||||
describe ".download" do
|
||||
it "uses send_file to transmit the export file" do
|
||||
file = CsvExportLog.create(export_type: "user", user_id: @user.id)
|
||||
file = UserExport.create(export_type: "user", user_id: @user.id)
|
||||
file_name = "export_#{file.id}.csv"
|
||||
controller.stubs(:render)
|
||||
export = CsvExportLog.new()
|
||||
CsvExportLog.expects(:get_download_path).with(file_name).returns(export)
|
||||
export = UserExport.new()
|
||||
UserExport.expects(:get_download_path).with(file_name).returns(export)
|
||||
subject.expects(:send_file).with(export)
|
||||
get :show, id: file_name
|
||||
response.should be_success
|
||||
@ -38,7 +38,7 @@ describe ExportCsvController do
|
||||
end
|
||||
|
||||
it "returns 404 when the export file does not exist" do
|
||||
CsvExportLog.expects(:get_download_path).returns(nil)
|
||||
UserExport.expects(:get_download_path).returns(nil)
|
||||
get :show, id: export_filename
|
||||
response.should be_not_found
|
||||
end
|
||||
@ -59,18 +59,18 @@ describe ExportCsvController do
|
||||
|
||||
describe ".download" do
|
||||
it "uses send_file to transmit the export file" do
|
||||
file = CsvExportLog.create(export_type: "admin", user_id: @admin.id)
|
||||
file = UserExport.create(export_type: "admin", user_id: @admin.id)
|
||||
file_name = "export_#{file.id}.csv"
|
||||
controller.stubs(:render)
|
||||
export = CsvExportLog.new()
|
||||
CsvExportLog.expects(:get_download_path).with(file_name).returns(export)
|
||||
export = UserExport.new()
|
||||
UserExport.expects(:get_download_path).with(file_name).returns(export)
|
||||
subject.expects(:send_file).with(export)
|
||||
get :show, id: file_name
|
||||
response.should be_success
|
||||
end
|
||||
|
||||
it "returns 404 when the export file does not exist" do
|
||||
CsvExportLog.expects(:get_download_path).returns(nil)
|
||||
UserExport.expects(:get_download_path).returns(nil)
|
||||
get :show, id: export_filename
|
||||
response.should be_not_found
|
||||
end
|
||||
|
Reference in New Issue
Block a user