Sha256: db4b38e8a119982ac106aa20c6701eb79a29830b4fa7d705f043d497663f5358

Contents?: true

Size: 1.17 KB

Versions: 47

Compression:

Stored size: 1.17 KB

Contents

require 'spec_helper'

describe Dugway::Drops::CategoriesDrop do
  let(:categories) { Dugway::Drops::CategoriesDrop.new(Dugway.store.categories.map { |c| Dugway::Drops::CategoryDrop.new(c) }) }

  describe "#all" do
    it "should return an array of all categories" do
      all = categories.all
      all.should be_an_instance_of(Array)
      all.size.should == 4

      category = all.first
      category.should be_an_instance_of(Dugway::Drops::CategoryDrop)
      category.name.should == 'CDs'
    end
  end

  describe "#active" do
    it "should return an array of all active categories" do
      active = categories.active
      active.should be_an_instance_of(Array)
      active.size.should == 2

      category = active.first
      category.should be_an_instance_of(Dugway::Drops::CategoryDrop)
      category.name.should == 'Prints'
    end
  end

  describe "#permalink" do
    it "should return the category by permalink" do
      category = categories.prints
      category.should be_an_instance_of(Dugway::Drops::CategoryDrop)
      category.name.should == 'Prints'
    end

    it "should return the nil for an invalid permalink" do
      categories.blah.should be_nil
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
dugway-1.0.10 spec/units/dugway/liquid/drops/categories_drop_spec.rb
dugway-1.0.9 spec/units/dugway/liquid/drops/categories_drop_spec.rb
dugway-1.0.8 spec/units/dugway/liquid/drops/categories_drop_spec.rb
dugway-1.0.7 spec/units/dugway/liquid/drops/categories_drop_spec.rb
dugway-1.0.6 spec/units/dugway/liquid/drops/categories_drop_spec.rb
dugway-1.0.5 spec/units/dugway/liquid/drops/categories_drop_spec.rb
dugway-1.0.4 spec/units/dugway/liquid/drops/categories_drop_spec.rb
dugway-1.0.3 spec/units/dugway/liquid/drops/categories_drop_spec.rb
dugway-1.0.2 spec/units/dugway/liquid/drops/categories_drop_spec.rb
dugway-1.0.1 spec/units/dugway/liquid/drops/categories_drop_spec.rb
dugway-1.0.0 spec/units/dugway/liquid/drops/categories_drop_spec.rb
dugway-0.12.3 spec/units/dugway/liquid/drops/categories_drop_spec.rb
dugway-0.12.2 spec/units/dugway/liquid/drops/categories_drop_spec.rb
dugway-0.12.1 spec/units/dugway/liquid/drops/categories_drop_spec.rb
dugway-0.12.0 spec/units/dugway/liquid/drops/categories_drop_spec.rb
dugway-0.11.4 spec/units/dugway/liquid/drops/categories_drop_spec.rb
dugway-0.11.3 spec/units/dugway/liquid/drops/categories_drop_spec.rb
dugway-0.11.2 spec/units/dugway/liquid/drops/categories_drop_spec.rb
dugway-0.11.1 spec/units/dugway/liquid/drops/categories_drop_spec.rb
dugway-0.11.0 spec/units/dugway/liquid/drops/categories_drop_spec.rb