Sha256: 665d9b23d03247d17891fe23c5934bf6ac94280399ee1dcf7be3e396cdc8d964

Contents?: true

Size: 850 Bytes

Versions: 57

Compression:

Stored size: 850 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe Post do
  before do
    @post = Factory(:post)
    @post_activity_object = @post.activity_object
    @post_activity = @post.post_activity
  end 

  describe "with like activity" do
    before do
      @like_activity = Factory(:like_activity, :parent => @post_activity)
    end

    describe "when destroying" do
      before do
        @post.try(:destroy)
      end

      it "should also destroy its activity_object" do
        assert_nil ActivityObject.find_by_id(@post_activity_object.id)
      end

      it "should also destroy its post_activity" do
        assert_nil Activity.find_by_id(@post_activity.id)
      end

      it "should also destroy its children like activity" do
        assert_nil Activity.find_by_id(@like_activity.id)
      end
    end
  end
end

Version data entries

57 entries across 57 versions & 2 rubygems

Version Path
social_stream-base-0.9.4 spec/models/post_spec.rb
social_stream-base-0.9.3 spec/models/post_spec.rb
social_stream-base-0.9.2 spec/models/post_spec.rb
social_stream-base-0.9.1 spec/models/post_spec.rb
social_stream-base-0.9.0 spec/models/post_spec.rb
social_stream-base-0.8.2 spec/models/post_spec.rb
social_stream-base-0.8.1 spec/models/post_spec.rb
social_stream-base-0.8.0 spec/models/post_spec.rb
social_stream-base-0.7.11 spec/models/post_spec.rb
social_stream-base-0.7.10 spec/models/post_spec.rb
social_stream-base-0.7.9 spec/models/post_spec.rb
social_stream-base-0.7.8 spec/models/post_spec.rb
social_stream-base-0.7.7 spec/models/post_spec.rb
social_stream-base-0.7.6 spec/models/post_spec.rb
social_stream-base-0.7.5 spec/models/post_spec.rb
social_stream-base-0.7.4 spec/models/post_spec.rb
social_stream-base-0.7.3 spec/models/post_spec.rb
social_stream-base-0.7.2 spec/models/post_spec.rb
social_stream-base-0.7.1 spec/models/post_spec.rb
social_stream-base-0.7.0 spec/models/post_spec.rb