Sha256: cd123ab70c67b4417c366e9f1964f985b99ac2098a83b29ae1c5d772e3d081bd

Contents?: true

Size: 986 Bytes

Versions: 21

Compression:

Stored size: 986 Bytes

Contents

require 'spec_helper'

describe Dugway::Drops::PagesDrop do
  let(:pages) { Dugway::Drops::PagesDrop.new(Dugway.store.pages.map { |p| Dugway::Drops::PageDrop.new(p) }) }

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

      page = all.first
      page.should be_an_instance_of(Dugway::Drops::PageDrop)
      page.name.should == 'About Us'
    end
  end

  describe "#permalink" do
    it "should return the page by permalink" do
      page = pages.contact
      page.should be_an_instance_of(Dugway::Drops::PageDrop)
      page.name.should == 'Contact'
    end

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

  private

  def rendered_template(template, assigns={}, registers={})
    Liquid::Template.parse(template).render(assigns, :registers => { :currency => Dugway.store.currency }.merge(registers))
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
dugway-1.0.1 spec/units/dugway/liquid/drops/pages_drop_spec.rb
dugway-1.0.0 spec/units/dugway/liquid/drops/pages_drop_spec.rb
dugway-0.12.3 spec/units/dugway/liquid/drops/pages_drop_spec.rb
dugway-0.12.2 spec/units/dugway/liquid/drops/pages_drop_spec.rb
dugway-0.12.1 spec/units/dugway/liquid/drops/pages_drop_spec.rb
dugway-0.12.0 spec/units/dugway/liquid/drops/pages_drop_spec.rb
dugway-0.11.4 spec/units/dugway/liquid/drops/pages_drop_spec.rb
dugway-0.11.3 spec/units/dugway/liquid/drops/pages_drop_spec.rb
dugway-0.11.2 spec/units/dugway/liquid/drops/pages_drop_spec.rb
dugway-0.11.1 spec/units/dugway/liquid/drops/pages_drop_spec.rb
dugway-0.11.0 spec/units/dugway/liquid/drops/pages_drop_spec.rb
dugway-0.10.5 spec/units/dugway/liquid/drops/pages_drop_spec.rb
dugway-0.10.4 spec/units/dugway/liquid/drops/pages_drop_spec.rb
dugway-0.10.3 spec/units/dugway/liquid/drops/pages_drop_spec.rb
dugway-0.10.2 spec/units/dugway/liquid/drops/pages_drop_spec.rb
dugway-0.10.1 spec/units/dugway/liquid/drops/pages_drop_spec.rb
dugway-0.10.0 spec/units/dugway/liquid/drops/pages_drop_spec.rb
dugway-0.9.0 spec/units/dugway/liquid/drops/pages_drop_spec.rb
dugway-0.8.4 spec/units/dugway/liquid/drops/pages_drop_spec.rb
dugway-0.8.3 spec/units/dugway/liquid/drops/pages_drop_spec.rb