Sha256: 9bdeb5f91d980e47ff781e402f0bd509d0360ddfa7c2fc3cb18e824f5b8c206e

Contents?: true

Size: 1.59 KB

Versions: 11

Compression:

Stored size: 1.59 KB

Contents

require "spec_helper"

module SocialNetworking
  module Concerns
    # Collects data for feed/profiles page.
    describe ShowFeed do
      fixtures(:all)
      let(:terminated_participant) { participants(:participant1) }
      let(:participant1) { participants(:participant1) }
      let(:participant2) { participants(:participant2) }
      let(:participant3) { participants(:participant3) }
      let(:show_feed_extension) { Class.new { extend ShowFeed } }
      let(:active_record_results) do
        double("active_record_results", pluck: nil)
      end
      let(:array_results) { double("participant_array") }

      it "should exclude terminated participants from profile list" do
        expect(participant1)
          .to receive(:active_group) do
          double("active_record_results",
                 active_participants: active_record_results)
        end
        allow(active_record_results).to receive(:to_a) { array_results }
        allow(array_results).to receive(:delete_if) { [participant1] }
        allow(participant2)
          .to receive(:active_group)
          .exactly(8).times do
          double("result", active_participants: active_record_results)
        end
        allow(participant1)
          .to receive(:active_group)
          .exactly(8).times do
          double("result", active_participants: active_record_results)
        end

        test = show_feed_extension
               .feed_data_for(
                 participant1,
                 double("context",
                        social_networking_profile_path: "some_path"))
        puts test.inspect
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
social_networking-0.11.8 spec/controllers/social_networking/concerns/show_feed_spec.rb
social_networking-0.11.7 spec/controllers/social_networking/concerns/show_feed_spec.rb
social_networking-0.11.6 spec/controllers/social_networking/concerns/show_feed_spec.rb
social_networking-0.11.5 spec/controllers/social_networking/concerns/show_feed_spec.rb
social_networking-0.11.4 spec/controllers/social_networking/concerns/show_feed_spec.rb
social_networking-0.11.3 spec/controllers/social_networking/concerns/show_feed_spec.rb
social_networking-0.11.2 spec/controllers/social_networking/concerns/show_feed_spec.rb
social_networking-0.11.1 spec/controllers/social_networking/concerns/show_feed_spec.rb
social_networking-0.11.0 spec/controllers/social_networking/concerns/show_feed_spec.rb
social_networking-0.10.0 spec/controllers/social_networking/concerns/show_feed_spec.rb
social_networking-0.9.3 spec/controllers/social_networking/concerns/show_feed_spec.rb