Sha256: 601bceb192207037fe5dc5f804b813762a3fd59f2b489a9a5448af71012ad3c9

Contents?: true

Size: 595 Bytes

Versions: 2

Compression:

Stored size: 595 Bytes

Contents

require 'spec_helper'

module Feeder
  describe Item do
    describe "#type" do
      it "returns the lowercase version of the feedable's type, separating words with an underscore" do
        subject.stub(:feedable_type).and_return "SomeFeedable"
        expect(subject.type).to eq "some_feedable"
      end

      context "when the feedable is namespaced" do
        it "splits each namespace with a forward slash" do
          subject.stub(:feedable_type).and_return "CoolApp::SomeFeedable"
          expect(subject.type).to eq "cool_app/some_feedable"
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
feeder-0.3.0 spec/models/feeder/item_spec.rb
feeder-0.2.0 spec/models/feeder/item_spec.rb