spec/lib/flapjack/data/contact_spec.rb in flapjack-0.7.4 vs spec/lib/flapjack/data/contact_spec.rb in flapjack-0.7.5

- old
+ new

@@ -36,11 +36,17 @@ :redis => @redis) Flapjack::Data::Contact.add({'id' => '363', 'first_name' => 'Jane', 'last_name' => 'Janeley', - 'email' => 'janej@example.com'}, + 'email' => 'janej@example.com', + 'media' => { + 'email' => { + 'address' => 'janej@example.com', + 'interval' => 60 + } + }}, :redis => @redis) end it "returns a list of all contacts" do contacts = Flapjack::Data::Contact.all(:redis => @redis) @@ -78,9 +84,16 @@ contact.name.should == 'Smithy Smith' nr = contact.notification_rules nr.should_not be_nil nr.should be_empty + end + + it "updates a contact and clears their media settings" do + contact = Flapjack::Data::Contact.find_by_id('363', :redis => @redis) + + contact.update('media' => {}) + contact.media.should be_empty end it "updates a contact, does not clear notification rules" do contact = Flapjack::Data::Contact.find_by_id('363', :redis => @redis) contact.should_not be_nil