Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Error when running routes test #161

Open
semaperepelitsa opened this Issue · 0 comments

1 participant

@semaperepelitsa

Example app: https://github.com/semaperepelitsa/spork_rails_app

# routes
SporkRailsApp::Application.routes.draw do
  resources :categories
end

# test/unit/routes_test.rb
require 'test_helper'

class RoutesTest < ActionController::TestCase
  def test_root
    assert_generates 'categories', controller: 'categories', action: "index"
  end
end

# Gemfile
group :test do
  gem 'spork', '~> 0.9.0.rc9'
  gem 'spork-testunit', git: "git://github.com/sporkrb/spork-testunit.git"
end
$ ruby -v
ruby 1.9.3p0

$ rake test:units
# pass
$ testdrb -Itest test/unit/routes_test.rb
  1) Error:
test_root(RoutesTest):
RuntimeError: route set not finalized
    /Users/sema/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:217:in `generate'
    /Users/sema/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/actionpack-3.1.3/lib/action_dispatch/routing/route_set.rb:453:in `generate'
    /Users/sema/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/actionpack-3.1.3/lib/action_dispatch/routing/route_set.rb:494:in `generate'
    /Users/sema/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/actionpack-3.1.3/lib/action_dispatch/routing/route_set.rb:490:in `generate_extras'
    /Users/sema/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/actionpack-3.1.3/lib/action_dispatch/testing/assertions/routing.rb:83:in `assert_generates'
    /Users/sema/Code/spork_rails_app/test/unit/routes_test.rb:5:in `test_root'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.