Update expected log in the specs

Akinori MUSHA 8 years ago
parent
commit
5d63aea08e
2 changed files with 4 additions and 4 deletions
  1. 3 3
      spec/concerns/dry_runnable_spec.rb
  2. 1 1
      spec/controllers/agents_controller_spec.rb

+ 3 - 3
spec/concerns/dry_runnable_spec.rb

@@ -70,7 +70,7 @@ describe DryRunnable do
70 70
       [@agent.memory, counts]
71 71
     }
72 72
 
73
-    expect(results[:log]).to match(/\AE, .+ ERROR -- : Exception during dry-run. SandboxedAgent does not support dry-run: /)
73
+    expect(results[:log]).to match(/\A\[\d\d:\d\d:\d\d\] INFO -- : Dry Run failed\n\[\d\d:\d\d:\d\d\] ERROR -- : Exception during dry-run. SandboxedAgent does not support dry-run: /)
74 74
     expect(results[:events]).to eq([])
75 75
     expect(results[:memory]).to eq({})
76 76
   end
@@ -86,7 +86,7 @@ describe DryRunnable do
86 86
         [@agent.memory, counts]
87 87
       }
88 88
 
89
-      expect(results[:log]).to match(/\AI, .+ INFO -- : Logging\nE, .+ ERROR -- : Recording error\n/)
89
+      expect(results[:log]).to match(/\A\[\d\d:\d\d:\d\d\] INFO -- : Dry Run started\n\[\d\d:\d\d:\d\d\] INFO -- : Logging\n\[\d\d:\d\d:\d\d\] ERROR -- : Recording error\n/)
90 90
       expect(results[:events]).to eq([{ 'test' => 'foo' }, { 'test' => 'bar' }])
91 91
       expect(results[:memory]).to eq({ 'last_status' => 'ok', 'dry_run' => true })
92 92
     end
@@ -101,7 +101,7 @@ describe DryRunnable do
101 101
         [@agent.memory, counts]
102 102
       }
103 103
 
104
-      expect(results[:log]).to match(/\AI, .+ INFO -- : Logging\nE, .+ ERROR -- : Recording error\n/)
104
+      expect(results[:log]).to match(/\A\[\d\d:\d\d:\d\d\] INFO -- : Dry Run started\n\[\d\d:\d\d:\d\d\] INFO -- : Logging\n\[\d\d:\d\d:\d\d\] ERROR -- : Recording error\n/)
105 105
       expect(results[:events]).to eq([{ 'test' => 'superfoo' }, { 'test' => 'superbar' }])
106 106
       expect(results[:memory]).to eq({ 'last_status' => 'ok', 'dry_run' => true })
107 107
     end

+ 1 - 1
spec/controllers/agents_controller_spec.rb

@@ -406,7 +406,7 @@ describe AgentsController do
406 406
         [users(:bob).agents.count, users(:bob).events.count, users(:bob).logs.count, agent.name, agent.updated_at]
407 407
       }
408 408
       json = JSON.parse(response.body)
409
-      expect(json['log']).to match(/^I, .* : Fetching #{Regexp.quote(url_from_event)}$/)
409
+      expect(json['log']).to match(/^\[\d\d:\d\d:\d\d\] INFO -- : Fetching #{Regexp.quote(url_from_event)}$/)
410 410
     end
411 411
   end
412 412