Add specs to test error marks

This commit is contained in:
Dzmitry Plashchynski
2015-03-10 23:37:15 +02:00
parent 6674bca0be
commit 6859d1f09a

View File

@@ -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