display/preload the logs of the last/current operation

This commit is contained in:
Régis Hanol
2014-02-13 10:41:46 -08:00
parent 50273ba815
commit b89d328de2
5 changed files with 35 additions and 7 deletions

View File

@ -16,13 +16,16 @@ describe Admin::BackupsController do
context "html format" do
it "preloads both backups and operations_status" do
it "preloads important data" do
Backup.expects(:all).returns([])
subject.expects(:store_preloaded).with("backups", "[]")
BackupRestore.expects(:operations_status).returns({})
subject.expects(:store_preloaded).with("operations_status", "{}")
BackupRestore.expects(:logs).returns([])
subject.expects(:store_preloaded).with("logs", "[]")
xhr :get, :index, format: :html
response.should be_success
@ -134,15 +137,17 @@ describe Admin::BackupsController do
describe ".logs" do
it "preloads operations_status" do
it "preloads important data" do
BackupRestore.expects(:operations_status).returns({})
subject.expects(:store_preloaded).with("operations_status", "{}")
BackupRestore.expects(:logs).returns([])
subject.expects(:store_preloaded).with("logs", "[]")
xhr :get, :logs, format: :html
response.should be_success
end
end
describe ".restore" do