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

noreply at rubyforge.org noreply at rubyforge.org
Tue Nov 21 04:52:34 EST 2006


Bugs item #6780, was opened at 2006-11-19 16: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: Gustav Paul (gustavpaul)
Date: 2006-11-21 11:52

Message:
First of all...
I'm terribly sorry that I took so long to respond!

Second...
Yup, I'm on edge rails, I followed these guidelines if
that's any help :]

http://www.flpr.org/2006/11/15/edge-rspec-on-rails

With only minor deviations...
I ran svn exported rspec and the rspec_on_rails plugin
instead of checking out.

EDGE REVISION 5526 (according to /vendor/rails/)

Thanks everyone,
Gustav

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

Comment By: Marcus Roberts (marcusr)
Date: 2006-11-21 11:09

Message:
I see the same problem.  I'm running on edge rails (REVISION_5587) using RSPec gem 0.7.2  and Rspec Rails plugin checked out with ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/REL_0_7_2/vendor/rspec_on_rails/vendor/plugins/rspec.

Removing the [0] from the same line (line number 142 in my version) of /vendor/plugins/rspec_on_rails/lib/spec/rails/context/controller.rb removes the error of

"47 should == "/customers" in my own test

Marcus



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

Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2006-11-20 17: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-20 05: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