Sha256: 5ffb72e2ce966db37d0e9a959cc25097c8de8e70eb3416aebdf62f402ad1ab6e

Contents?: true

Size: 1019 Bytes

Versions: 1

Compression:

Stored size: 1019 Bytes

Contents

require 'spec_helper'

module ShouldaRouting
  module Routes
    describe STACK do
      it { should be_an_instance_of(Stack) }
    end

    describe Stack do
      it { subject.class.should include(Routes::Helpers) }

      describe "#resources" do
        it "returns a cached array" do
          subject.resources.should eq []
          subject.resources.push(:users)
          subject.resources.should eq [:users]
        end
      end

      describe "#namespaces" do
        it "returns a cached array" do
          subject.namespaces.should eq []
          subject.namespaces.push(:admin)
          subject.namespaces.should eq [:admin]
        end
      end

      describe "#routes" do
        pending
      end

      describe "-#stack" do
        it "returns an array with resources and namespaces" do
          subject.stub(:namespaces).and_return([1,2,3])
          subject.stub(:resources).and_return([4,5,6])
          subject.send(:stack).should eq [1,2,3,4,5,6]
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shoulda_routing-0.0.2 spec/shoulda_routing/routes/stack_spec.rb