Sha256: 9cf71fc73445bfcc5c3b1808d2a8ee82825a9c379bc9454855e7c7b8d96d18b7

Contents?: true

Size: 1.26 KB

Versions: 11

Compression:

Stored size: 1.26 KB

Contents

require "spec_helper"

module SocialNetworking
  RSpec.describe "social_networking/coach/patient_dashboards"\
                 "/tables/_on_my_mind_statements.html.erb",
                 type: :view do
    describe "Shared on my mind statements" do
      let(:statement) do
        instance_double(
          OnTheMindStatement,
          created_at: Time.zone.now)
      end
      let(:membership) { instance_double(::Membership) }

      describe "Statments exist" do
        before do
          expect(membership)
            .to receive(:on_the_minds) { [statement]  }
          expect(statement)
            .to receive_messages(
              comments: [],
              description: "Windy cIty raiLz",
              likes: [])
          expect(view)
            .to receive_messages(
              week_in_study: 1)

          render partial: "social_networking/coach/patient_dashboards"\
                 "/tables/on_my_mind_statements",
                 locals: { membership: membership }
        end

        it "displays description" do
          expect(rendered).to have_text "Windy cIty raiLz"
        end

        it "displays correct formatted date time" do
          expect(rendered).to have_text statement.created_at.to_s(:standard)
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
social_networking-0.11.8 spec/views/social_networking/coach/patient_dashboards/tables/_on_my_mind_statements.html.erb_spec.rb
social_networking-0.11.7 spec/views/social_networking/coach/patient_dashboards/tables/_on_my_mind_statements.html.erb_spec.rb
social_networking-0.11.6 spec/views/social_networking/coach/patient_dashboards/tables/_on_my_mind_statements.html.erb_spec.rb
social_networking-0.11.5 spec/views/social_networking/coach/patient_dashboards/tables/_on_my_mind_statements.html.erb_spec.rb
social_networking-0.11.4 spec/views/social_networking/coach/patient_dashboards/tables/_on_my_mind_statements.html.erb_spec.rb
social_networking-0.11.3 spec/views/social_networking/coach/patient_dashboards/tables/_on_my_mind_statements.html.erb_spec.rb
social_networking-0.11.2 spec/views/social_networking/coach/patient_dashboards/tables/_on_my_mind_statements.html.erb_spec.rb
social_networking-0.11.1 spec/views/social_networking/coach/patient_dashboards/tables/_on_my_mind_statements.html.erb_spec.rb
social_networking-0.11.0 spec/views/social_networking/coach/patient_dashboards/tables/_on_my_mind_statements.html.erb_spec.rb
social_networking-0.10.0 spec/views/social_networking/coach/patient_dashboards/tables/_on_my_mind_statements.html.erb_spec.rb
social_networking-0.9.3 spec/views/social_networking/coach/patient_dashboards/tables/_on_my_mind_statements.html.erb_spec.rb