Sha256: 2ce0ffcea5ae65fa72042ef5724f3df8422168eb73bb5d0b5947ca3f5123fa4e
Contents?: true
Size: 768 Bytes
Versions: 13
Compression:
Stored size: 768 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe CloudfujiLeadObserver do before do @observer = CloudfujiLeadObserver.send :new end it "should process an event rule when a lead column is updated" do user = FactoryGirl.create(:user, :ido_id => "1234") @lead = FactoryGirl.create(:lead, :first_name => "Henry", :user => user, :campaign => nil) EventRule.create!( :event_category => "lead_attribute_changed", :lead_attribute => "first_name", :action => "change_lead_score", :change_score_by => 5 ) EventRule.any_instance.should_receive(:process).with(@lead, ['Henry', 'George']) @lead.first_name = "George" @observer.after_update(@lead) end end
Version data entries
13 entries across 13 versions & 1 rubygems