Sha256: 59502f3db40c429a6c829a23471649ab66008e961a4ce7ac6e70927cd4c91a19

Contents?: true

Size: 1.03 KB

Versions: 5

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true
require "spec_helper"

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

      def data
        @data ||= SocialNetworking::Reports::Goal.all
      end

      describe ".all" do
        context "when no goals created" do
          it "returns an empty array" do
            SocialNetworking::Goal.destroy_all

            expect(data).to be_empty
          end
        end

        context "when goals created" do
          it "returns accurate summaries" do
            participant = participants(:participant1)
            goal = SocialNetworking::Goal.first
            expect(data.count).to be > 10
            expect(data).to include(
              participant_id: participant.study_id,
              created_at: goal.created_at.iso8601,
              due_on: goal.due_on.iso8601,
              is_completed: goal.is_completed,
              is_deleted: goal.is_deleted,
              description: goal.description
            )
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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