Sha256: e06e6dff6df95aa8cee73411f8eeccb18e4cfdcba397b1b96a05fe2e942dbc26

Contents?: true

Size: 651 Bytes

Versions: 1

Compression:

Stored size: 651 Bytes

Contents

require "#{File.expand_path(File.dirname(__FILE__))}/helper"

describe "Configurator" do  
  
  before :all do
    class ::BlogControllerSpec; end    
  end
  
  after :all do
    remove_constants %w(BlogControllerSpec)
  end
  
  before :each do
    @named_router = Crystal::NamedRouter.new
    
    @router = Crystal::Router.new :class
    @router.routes.unshift :named_router, @named_router
    
    Crystal::Routes::Configurator.stub(:router).and_return(@router)
  end
  
  it "named routes" do
    crystal.routes do |config|
      config.named_route 'blog', BlogControllerSpec
    end
    
    @named_router.names.should include('blog')
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
crystal_ext-0.0.11 spec/router/configurator_spec.rb