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

noreply at rubyforge.org noreply at rubyforge.org
Thu Nov 23 13:58:06 EST 2006


Bugs item #6780, was opened at 2006-11-19 14: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: Closed
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: David Chelimsky (dchelimsky)
Date: 2006-11-23 18:58

Message:
Actually I hadn't! But I have now as of rev 1134.

The two versions handle routing differently. All I did was to check if we're getting a String or an Array. Pretty simple really.



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

Comment By: Gustav Paul (gustavpaul)
Date: 2006-11-23 18:02

Message:
Great!
I'm curious as to how you fixed it? (reconciling 1.1.6 with
edge?)

Gustav

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

Comment By: David Chelimsky (dchelimsky)
Date: 2006-11-23 17:56

Message:
Fixed in trunk rev 1132.

This now works for Rails 1.1.6 and edge.

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

Comment By: Gustav Paul (gustavpaul)
Date: 2006-11-21 09: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 09: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 15: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 03: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