Sha256: 6fe4be5c5410ce68d35ba533aeca48dc64eb40d12a92a19bcaed7dc9203e1684

Contents?: true

Size: 732 Bytes

Versions: 1

Compression:

Stored size: 732 Bytes

Contents

require 'spec_helper'

describe Feeder::Concerns::Feedable do
  subject { Message.new }

  it 'responds to sticky' do
    expect(subject).to respond_to :sticky
  end

  it 'responds to sticky='  do
    expect(subject).to respond_to :sticky=
  end

  context 'with a feeder item' do
    before do
      expect(subject).to receive(:feeder_item).and_return(double sticky: true).at_least(1).times
    end

    it 'delegates sticky to it' do
      expect(subject.sticky).to eq true
    end
  end

  context 'without a feeder item' do
    before do
      expect(subject).to receive(:feeder_item).and_return(nil).at_least(1).times
    end

    it 'mainstains state internally' do
      expect(subject.sticky).to eq false
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
feeder-0.5.1 spec/lib/feeder/concerns/feedable_spec.rb