Sha256: 24ec2c02a2699e4353a1c1fe8c0bb9248123264832a8785e44fdad2dc576b6b6

Contents?: true

Size: 609 Bytes

Versions: 3

Compression:

Stored size: 609 Bytes

Contents

require 'spec_helper'

require 'flapjack/data/medium'

describe Flapjack::Data::Medium, :redis => true do

  it "requires the interval be set for email" do
    medium = Flapjack::Data::Medium.new(:transport => 'email')
    expect(medium.valid?).to be false
    expect(medium.errors[:interval]).to match_array(["can't be blank", "is not a number"])
  end

  it "requires the interval be nil for pagerduty" do
    medium = Flapjack::Data::Medium.new(:transport => 'pagerduty', :interval => 5)
    expect(medium.valid?).to be false
    expect(medium.errors[:interval]).to match_array(["must be nil"])
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flapjack-2.0.0 spec/lib/flapjack/data/medium_spec.rb
flapjack-2.0.0rc1 spec/lib/flapjack/data/medium_spec.rb
flapjack-2.0.0b1 spec/lib/flapjack/data/medium_spec.rb