runners_helper_spec.rb 595 Bytes
Newer Older
1 2
require 'spec_helper'

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
3
describe Ci::RunnersHelper do
4
  it "returns - not contacted yet" do
5 6
    runner = FactoryGirl.build :ci_runner
    expect(runner_status_icon(runner)).to include("not connected yet")
7 8 9
  end

  it "returns offline text" do
10 11
    runner = FactoryGirl.build(:ci_runner, contacted_at: 1.day.ago, active: true)
    expect(runner_status_icon(runner)).to include("Runner is offline")
12 13 14
  end

  it "returns online text" do
15 16
    runner = FactoryGirl.build(:ci_runner, contacted_at: 1.hour.ago, active: true)
    expect(runner_status_icon(runner)).to include("Runner is online")
17 18
  end
end