Methods
- S
- T
-
- test_assert_generates,
- test_assert_generates_with_defaults,
- test_assert_generates_with_extras,
- test_assert_recognizes,
- test_assert_recognizes_raises_message,
- test_assert_recognizes_with_block_constraint,
- test_assert_recognizes_with_extras,
- test_assert_recognizes_with_hash_constraint,
- test_assert_recognizes_with_method,
- test_assert_recognizes_with_query_constraint,
- test_assert_routing,
- test_assert_routing_raises_message,
- test_assert_routing_with_block_constraint,
- test_assert_routing_with_defaults,
- test_assert_routing_with_extras,
- test_assert_routing_with_hash_constraint,
- test_with_routing
Instance Public methods
setup()
Link
# File actionpack/test/dispatch/routing_assertions_test.rb, line 10 def setup @routes = ActionDispatch::Routing::RouteSet.new @routes.draw do resources :articles scope 'secure', :constraints => { :protocol => 'https://' } do resources :articles, :controller => 'secure_articles' end scope 'block', :constraints => lambda { |r| r.ssl? } do resources :articles, :controller => 'block_articles' end scope 'query', :constraints => lambda { |r| r.params[:use_query] == 'true' } do resources :articles, :controller => 'query_articles' end end end
test_assert_generates()
Link
test_assert_generates_with_defaults()
Link
test_assert_generates_with_extras()
Link
test_assert_recognizes()
Link
# File actionpack/test/dispatch/routing_assertions_test.rb, line 42 def test_assert_recognizes assert_recognizes({ :controller => 'articles', :action => 'index' }, '/articles') assert_recognizes({ :controller => 'articles', :action => 'show', :id => '1' }, '/articles/1') end
test_assert_recognizes_raises_message()
Link
# File actionpack/test/dispatch/routing_assertions_test.rb, line 77 def test_assert_recognizes_raises_message err = assert_raise(Assertion) do assert_recognizes({ :controller => 'secure_articles', :action => 'index' }, 'http://test.host/secure/articles', {}, "This is a really bad msg") end assert_match err.message, "This is a really bad msg" end
test_assert_recognizes_with_block_constraint()
Link
# File actionpack/test/dispatch/routing_assertions_test.rb, line 63 def test_assert_recognizes_with_block_constraint assert_raise(Assertion) do assert_recognizes({ :controller => 'block_articles', :action => 'index' }, 'http://test.host/block/articles') end assert_recognizes({ :controller => 'block_articles', :action => 'index' }, 'https://test.host/block/articles') end
test_assert_recognizes_with_extras()
Link
test_assert_recognizes_with_hash_constraint()
Link
# File actionpack/test/dispatch/routing_assertions_test.rb, line 56 def test_assert_recognizes_with_hash_constraint assert_raise(Assertion) do assert_recognizes({ :controller => 'secure_articles', :action => 'index' }, 'http://test.host/secure/articles') end assert_recognizes({ :controller => 'secure_articles', :action => 'index', :protocol => 'https://' }, 'https://test.host/secure/articles') end
test_assert_recognizes_with_method()
Link
# File actionpack/test/dispatch/routing_assertions_test.rb, line 51 def test_assert_recognizes_with_method assert_recognizes({ :controller => 'articles', :action => 'create' }, { :path => '/articles', :method => :post }) assert_recognizes({ :controller => 'articles', :action => 'update', :id => '1' }, { :path => '/articles/1', :method => :put }) end
test_assert_recognizes_with_query_constraint()
Link
# File actionpack/test/dispatch/routing_assertions_test.rb, line 70 def test_assert_recognizes_with_query_constraint assert_raise(Assertion) do assert_recognizes({ :controller => 'query_articles', :action => 'index', :use_query => 'false' }, '/query/articles', { :use_query => 'false' }) end assert_recognizes({ :controller => 'query_articles', :action => 'index', :use_query => 'true' }, '/query/articles', { :use_query => 'true' }) end
test_assert_routing()
Link
test_assert_routing_raises_message()
Link
# File actionpack/test/dispatch/routing_assertions_test.rb, line 89 def test_assert_routing_raises_message err = assert_raise(Assertion) do assert_routing('/thisIsNotARoute', { :controller => 'articles', :action => 'edit', :id => '1' }, { :id => '1' }, {}, "This is a really bad msg") end assert_match err.message, "This is a really bad msg" end
test_assert_routing_with_block_constraint()
Link
# File actionpack/test/dispatch/routing_assertions_test.rb, line 112 def test_assert_routing_with_block_constraint assert_raise(Assertion) do assert_routing('http://test.host/block/articles', { :controller => 'block_articles', :action => 'index' }) end assert_routing('https://test.host/block/articles', { :controller => 'block_articles', :action => 'index' }) end
test_assert_routing_with_defaults()
Link
test_assert_routing_with_extras()
Link
test_assert_routing_with_hash_constraint()
Link
# File actionpack/test/dispatch/routing_assertions_test.rb, line 105 def test_assert_routing_with_hash_constraint assert_raise(Assertion) do assert_routing('http://test.host/secure/articles', { :controller => 'secure_articles', :action => 'index' }) end assert_routing('https://test.host/secure/articles', { :controller => 'secure_articles', :action => 'index', :protocol => 'https://' }) end
test_with_routing()
Link
# File actionpack/test/dispatch/routing_assertions_test.rb, line 119 def test_with_routing with_routing do |routes| routes.draw do resources :articles, :path => 'artikel' end assert_routing('/artikel', :controller => 'articles', :action => 'index') assert_raise(Assertion) do assert_routing('/articles', { :controller => 'articles', :action => 'index' }) end end end