mirror of
https://github.com/plashchynski/crono.git
synced 2026-04-24 01:38:37 +02:00
Merge pull request #18 from michaelachrisco/view-multiple-states
Multiple View States
This commit is contained in:
@@ -29,6 +29,18 @@ describe Crono::Web do
|
|||||||
get '/'
|
get '/'
|
||||||
expect(last_response.body).to include 'Error'
|
expect(last_response.body).to include 'Error'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'should show a success mark when a job is healthy' do
|
||||||
|
@test_job.update(healthy: true)
|
||||||
|
get '/'
|
||||||
|
expect(last_response.body).to include 'Success'
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should show a pending mark when a job is pending' do
|
||||||
|
@test_job.update(healthy: nil)
|
||||||
|
get '/'
|
||||||
|
expect(last_response.body).to include 'Pending'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '/job/:id' do
|
describe '/job/:id' do
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
%tr
|
%tr
|
||||||
%th Job
|
%th Job
|
||||||
%th Last performed at
|
%th Last performed at
|
||||||
%th
|
%th Status
|
||||||
%th
|
%th
|
||||||
- @jobs.each do |job|
|
- @jobs.each do |job|
|
||||||
%tr
|
%tr
|
||||||
@@ -16,6 +16,12 @@
|
|||||||
- if job.healthy == false
|
- if job.healthy == false
|
||||||
%a{ href: url("/job/#{job.id}") }
|
%a{ href: url("/job/#{job.id}") }
|
||||||
%span.label.label-danger Error
|
%span.label.label-danger Error
|
||||||
|
- if job.healthy == true
|
||||||
|
%a{ href: url("/job/#{job.id}") }
|
||||||
|
%span.label.label-success Success
|
||||||
|
- else
|
||||||
|
%a{ href: url("/job/#{job.id}") }
|
||||||
|
%span.label.label-default Pending
|
||||||
%td
|
%td
|
||||||
%a{ href: url("/job/#{job.id}") }
|
%a{ href: url("/job/#{job.id}") }
|
||||||
Log
|
Log
|
||||||
|
|||||||
Reference in New Issue
Block a user