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