From 6859d1f09a4b8c76bd7d45e635e9c5bf696bc18d Mon Sep 17 00:00:00 2001 From: Dzmitry Plashchynski Date: Tue, 10 Mar 2015 23:37:15 +0200 Subject: [PATCH] Add specs to test error marks --- spec/web_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/web_spec.rb b/spec/web_spec.rb index c77bc23..69a2ee3 100644 --- a/spec/web_spec.rb +++ b/spec/web_spec.rb @@ -19,6 +19,12 @@ describe Crono::Web do expect(last_response).to be_ok expect(last_response.body).to include @test_job_id end + + it "should show a error mark when a job is unhealthy" do + @test_job.update(healthy: false) + get '/' + expect(last_response.body).to include "Error" + end end describe "/job/:id" do @@ -28,5 +34,11 @@ describe Crono::Web do expect(last_response.body).to include @test_job_id expect(last_response.body).to include @test_job_log end + + it "should show a message about the unhealthy job" do + @test_job.update(healthy: false) + get "/job/#{@test_job.id}" + expect(last_response.body).to include "An error occurs during the last execution of this job" + end end end