Sha256: 4ac64b7a92e21c1f6dc4c29e3b2f33104c6f5a25d711b981b6979dfd1e57d3e7

Contents?: true

Size: 1.05 KB

Versions: 4

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true
require "spec_helper"

module SocialNetworking
  module Reports
    RSpec.describe ToolShare do
      fixtures :all

      def data
        @data ||= ToolShare.all
      end

      describe ".all" do
        context "when no items shared" do
          it "returns an empty array" do
            SocialNetworking::SharedItem.destroy_all
            expect(data).to be_empty
          end
        end

        context "when items shared" do
          it "returns accurate summaries" do
            participant = participants(:participant1)
            otms = SocialNetworking::OnTheMindStatement
                   .create!(participant_id: participants(:participant1).id,
                            description: "otms description")
            shared_item = SharedItem.create!(item: otms)
            expect(data).to include(
              participant_id: participant.study_id,
              item_type: shared_item.item_type,
              shared_at: shared_item.created_at.iso8601
            )
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
social_networking-0.13.2 spec/models/social_networking/reports/tool_share_report_spec.rb
social_networking-0.13.1 spec/models/social_networking/reports/tool_share_report_spec.rb
social_networking-0.13.0 spec/models/social_networking/reports/tool_share_report_spec.rb
social_networking-0.12.0 spec/models/social_networking/reports/tool_share_report_spec.rb