Sha256: d1444fea74be426efbf9e4d6a34dcfd15943371f3ebc898e899cdfaebecc6e2c

Contents?: true

Size: 1.63 KB

Versions: 1

Compression:

Stored size: 1.63 KB

Contents

require 'spec_helper'

require 'flapjack/data/contact'

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

  it "returns a list of all contacts" do
    Flapjack::Data::Contact.add({'id'         => '362',
                                 'first_name' => 'John',
                                 'last_name'  => 'Johnson',
                                 'email'      => 'johnj@example.com' },
                                 :redis       => @redis)
    Flapjack::Data::Contact.add({'id'         => '363',
                                 'first_name' => 'Jane',
                                 'last_name'  => 'Janeley',
                                 'email'      => 'janej@example.com'},
                                 :redis       => @redis)

    contacts = Flapjack::Data::Contact.all(:redis => @redis)
    contacts.should_not be_nil
    contacts.should be_an(Array)
    contacts.should have(2).contacts
    contacts[0].id.should == '362'
    contacts[1].id.should == '363'
  end

  it "finds a contact by id" do
    Flapjack::Data::Contact.add({'id'         => '362',
                                 'first_name' => 'John',
                                 'last_name'  => 'Johnson',
                                 'email'      => 'johnj@example.com' },
                                 :redis       => @redis)

    contact = Flapjack::Data::Contact.find_by_id('362', :redis => @redis)
    contact.should_not be_nil
    contact.name.should == "John Johnson"
  end

  it "finds all contacts for a check on an entity"

  it "deletes all contacts"

  it "returns pagerduty credentials for a contact"

  it "returns a list of entities for a contact"

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flapjack-0.6.39 spec/lib/flapjack/data/contact_spec.rb