Welcome to mirror list, hosted at ThFree Co, Russian Federation.

others_data_serializer_spec.rb « export « serializers « spec - github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2c40adfb80c08196e728716dfbdefb14510e9787 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

describe Export::OthersDataSerializer do
  let(:user) { FactoryGirl.create(:user) }
  let(:serializer) { Export::OthersDataSerializer.new(user.id) }

  it "uses FederationEntitySerializer for array serializing relayables" do
    sm = DataGenerator.new(user).status_message_with_activity

    expect(Export::OthersDataSerializer).to serialize_association(:relayables)
      .with_each_serializer(FederationEntitySerializer)
      .with_objects([*sm.likes, *sm.comments, *sm.poll_participations])
    serializer.associations
  end

  context "with user's activity" do
    before do
      DataGenerator.new(user).activity
    end
  end
end