Last active
December 22, 2015 23:49
-
-
Save ujjwalt/6549756 to your computer and use it in GitHub Desktop.
My valiant attempt at writing a routing test - have no clue how to write one
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'abstract_unit' | |
require 'controller/fake_controllers' | |
class TestCollectionRouting < ActionDispatch::IntegrationTest | |
test "collection option" do | |
with_routing do |set| | |
set.draw do | |
resources :posts, collection: true | |
end | |
assert_routing "/posts/1", {controller: "posts", action: "show", id: "1"} | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Don't use
assert_routing
- it only works in functional tests.Here's a skeleton that you can use: