[rspec-devel] [ rspec-Bugs-6780 ] routing() was failing...fix included

noreply at rubyforge.org noreply at rubyforge.org
Mon Nov 20 10:04:38 EST 2006


Bugs item #6780, was opened at 2006-11-19 09:49
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=6780&group_id=797

Category: rails plugin
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Gustav Paul (gustavpaul)
Assigned to: David Chelimsky (dchelimsky)
Summary: routing() was failing...fix included

Initial Comment:
Hey

I have the following route in my config/routes.rb:

map.connect 'login', :controller => 'member', :action => 'login'

my spec looks as follows

#no def setup or anything similar...
specify "/member/login should route to /login" do
  routing(:controller => 'member', :action => 'login').should_eql "/login"
end

Was failing, reporting inequality of 47 and '/login'
"/login"[0] happened to be char code 47

I've got the rails plugin installed as
/vendor/plugins/rspec_on_rails

In /vendor/plugins/rspec_on_rails/lib/spec/rails/context/controller.rb
line #131
Was:
ActionController::Routing::Routes.generate(options)[0]

changed to 
ActionController::Routing::Routes.generate(options)

Working perfectly now...
Might have introduced other bugs, but I though I'd let you guys know...

Cheery-o
Gustav Paul
gustav at rails.co.za


----------------------------------------------------------------------

>Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2006-11-20 10:04

Message:
He's probably on edge rails. I think edge rails and 1.1.6 rails behave differently. In edge rails the [0] must go away. Maybe we need to do different things based on RAILS_VERSION or something.


----------------------------------------------------------------------

Comment By: David Chelimsky (dchelimsky)
Date: 2006-11-19 22:36

Message:
Gustav - I added a spec for this and it passed right away. It's committed in revision (1126).

What version of RSpec were you using when this happened? Trunk revision? Rails version?

Thx

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=6780&group_id=797


More information about the rspec-devel mailing list