diff --git a/test/unit/scrap_test.rb b/test/unit/scrap_test.rb index b0173d1..8ccbedf 100644 --- a/test/unit/scrap_test.rb +++ b/test/unit/scrap_test.rb @@ -81,7 +81,7 @@ class ScrapTest < ActiveSupport::TestCase end should "create the leave_scrap action tracker verb on scrap creation of one user to another" do - p1 = ActionTracker::Record.current_user_from_model + p1 = fast_create(Person) p2 = fast_create(Person) s = Scrap.new s.sender= p1 @@ -116,7 +116,7 @@ class ScrapTest < ActiveSupport::TestCase end should "notify leave_scrap action tracker verb to friends and itself" do - p1 = ActionTracker::Record.current_user_from_model + p1 = fast_create(Person) p2 = fast_create(Person) p1.add_friend(p2) ActionTrackerNotification.destroy_all @@ -166,7 +166,7 @@ class ScrapTest < ActiveSupport::TestCase end should "notify leave_scrap_to_self action tracker verb to friends and itself" do - p1 = Person.first + p1 = fast_create(Person) p2 = fast_create(Person) p1.add_friend(p2) ActionTrackerNotification.destroy_all @@ -212,10 +212,10 @@ class ScrapTest < ActiveSupport::TestCase should "update the scrap on reply creation" do Scrap.delete_all + person = fast_create(Person) s = fast_create(Scrap, :updated_at => DateTime.parse('2010-01-01')) assert_equal DateTime.parse('2010-01-01'), s.updated_at.strftime('%Y-%m-%d') - DateTime.stubs(:now).returns(DateTime.parse('2010-09-07')) - s1 = Scrap.create(defaults_for_scrap(:scrap_id => s.id)) + s1 = Scrap.create!(:content => 'some content', :sender => person, :receiver => person, :scrap_id => s.id) s.reload assert_not_equal DateTime.parse('2010-01-01'), s.updated_at.strftime('%Y-%m-%d') end -- libgit2 0.21.2