test/fires_test.rb in giraffesoft-timeline_fu-0.2.0 vs test/fires_test.rb in giraffesoft-timeline_fu-0.3.0
- old
+ new
@@ -6,12 +6,15 @@
@mat = create_person(:email => 'mat@giraffesoft.ca')
end
def test_should_fire_the_appropriate_callback
@list = List.new(hash_for_list(:author => @james));
- TimelineEvent.expects(:create!).with(:actor => @james, :subject => @list, :event_type => 'list_created')
+ TimelineEvent.expects(:create!).with(:actor => @james, :subject => @list, :event_type => 'list_created_or_updated')
@list.save
+ TimelineEvent.expects(:create!).with(:actor => @mat, :subject => @list, :event_type => 'list_created_or_updated')
+ @list.author = @mat
+ @list.save
end
def test_should_fire_event_with_secondary_subject
@list = List.new(hash_for_list(:author => @james));
TimelineEvent.stubs(:create!)
@@ -59,10 +62,10 @@
@james.save
end
def test_should_set_secondary_subject_to_self_when_requested
@list = List.new(hash_for_list(:author => @james));
- TimelineEvent.stubs(:create!).with(has_entry(:event_type, "list_created"))
+ TimelineEvent.stubs(:create!).with(has_entry(:event_type, "list_created_or_updated"))
@list.save
@comment = Comment.new(:body => 'cool list!', :author => @mat, :list => @list)
TimelineEvent.stubs(:create!).with(has_entry(:event_type, "comment_created"))
@comment.save
TimelineEvent.expects(:create!).with(:actor => @mat,