diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-05-18 19:27:59 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-05-18 19:27:59 -0300 |
commit | 7145986e884915a8c1db0ea0b82f931379a402c5 (patch) | |
tree | 239b38e21ef22718c8a06d4a036e14041ad92b9f /actionpack/test/dispatch | |
parent | 9c4487517c90dad572502983779898058432a837 (diff) | |
parent | bad30ed46c64593f83ecccf10604c73667e12e2b (diff) | |
download | rails-7145986e884915a8c1db0ea0b82f931379a402c5.tar.gz rails-7145986e884915a8c1db0ea0b82f931379a402c5.tar.bz2 rails-7145986e884915a8c1db0ea0b82f931379a402c5.zip |
Merge pull request #20191 from juggernaut-/patch-1
Added ActionDispatch::Journey::Routes#empty?
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/routing/route_set_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing/route_set_test.rb b/actionpack/test/dispatch/routing/route_set_test.rb index fe52c50336..0c770a4406 100644 --- a/actionpack/test/dispatch/routing/route_set_test.rb +++ b/actionpack/test/dispatch/routing/route_set_test.rb @@ -17,6 +17,16 @@ module ActionDispatch @set = RouteSet.new end + test "not being empty when route is added" do + assert empty? + + draw do + get 'foo', to: SimpleApp.new('foo#index') + end + + refute empty? + end + test "url helpers are added when route is added" do draw do get 'foo', to: SimpleApp.new('foo#index') @@ -136,6 +146,10 @@ module ActionDispatch def url_helpers @set.url_helpers end + + def empty? + @set.empty? + end end end end |