No commit activity in last 3 years
No release in over 3 years
Extension to rspec-rails that allows some shortcuts in routing tests. With it, this: describe "users routes" do describe "GET /" do it{{:get => '/'}.should route_to "users#index"} end describe "POST /" do it{{:post => '/'}.should be_routable} end end can be written like this: describe "users routes" do get('/').should route_to "users#index" post('/').should be_routable end
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0.0
~> 1.5.2
>= 0

Runtime

>= 2.5.0
 Project Readme

RSpec Rails Extra Routing v0.1.0

Description

I've implement this gem to code some ideas of mine about how should be the rspec-route DSL.
Maybe some of this ideas makes sense for others developers, and can be joined to the rspec-rails in the future.
For now, is there only one feature 100% finished, but soon enough will be others.
Any feed back is welcomed.

Features

Hyper Shortcuts Pull Request discussion

This feature object is to simplify and DRY(Don't Repeat Yourself) the way you write your route test.

# Old Way
describe "GET /" do
  it { get("/").should route_to(
    :controller => "users",
    :action => "index"
  ) }
end

# HyperShortcut Way
get("/").should route_to(
  :controller => "users",
  :action => "index"
)

How use

Install the gem:

gem install rspec-rails-extra-routing

Load the gem in Gemfile:

# Gemfile
group :test do
  gem 'rspec-rails-extra-routing'
end

and require it above require "rspec/rails" in your spec/spec_helper file:

# spec/spec_helper.rb
... 
require "rspec/rails"
require "rspec/rails/extra/routing" # or rspec/rails/extra/FEATURE-PATH to
                                    # load a specific feature
...

Copyright

Copyright (c) 2011 HugoLnx. See LICENSE.txt for further details.