Sha256: 81778365edf6f2d6d8a6afb8866c8f6d5c095c8d2989387a8586442269059ee2

Contents?: true

Size: 1.19 KB

Versions: 11

Compression:

Stored size: 1.19 KB

Contents

require "spec_helper"

module SocialNetworking
  describe Shareable do
    context "when intialized without an instance" do
      subject(:shareable) { Shareable.new }

      describe "#action" do
        it "should display's the default action" do
          expect(shareable.action).to eq "Shared"
        end
      end
    end

    context "when intialized with an instance" do
      let(:action_text) { "I have an action" }
      let(:activity) { "ActivityKlass" }
      let(:goal) { double("goal", shared_description: "goal description") }
      subject(:shareable) { Shareable.new(activity) }

      describe "#action" do
        it "should display's an activities status label" do
          allow(activity).to receive(:action) { action_text }

          expect(shareable.action).to eq action_text
        end
      end

      describe "#description" do
        it "should output an item's shared description" do
          expect(Shareable.new(goal).description).to eq("goal description")
        end
        it "should output the default message for a nil item" do
          expect(Shareable.new(nil).description)
            .to eq("Description not available for this item.")
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
social_networking-0.11.8 spec/models/social_networking/shareable_spec.rb
social_networking-0.11.7 spec/models/social_networking/shareable_spec.rb
social_networking-0.11.6 spec/models/social_networking/shareable_spec.rb
social_networking-0.11.5 spec/models/social_networking/shareable_spec.rb
social_networking-0.11.4 spec/models/social_networking/shareable_spec.rb
social_networking-0.11.3 spec/models/social_networking/shareable_spec.rb
social_networking-0.11.2 spec/models/social_networking/shareable_spec.rb
social_networking-0.11.1 spec/models/social_networking/shareable_spec.rb
social_networking-0.11.0 spec/models/social_networking/shareable_spec.rb
social_networking-0.10.0 spec/models/social_networking/shareable_spec.rb
social_networking-0.9.3 spec/models/social_networking/shareable_spec.rb