diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-08-13 19:02:00 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-08-13 21:43:18 -0300 |
commit | 546497d027f9e4e55e99dbf7b499bb091d6b5d24 (patch) | |
tree | 4d93b1b8b27a6bd61f03224268e43f8a9b8a398f /actionpack/test/dispatch/routing | |
parent | 0dd24728a088fcb4ae616bb5d62734aca5276b1b (diff) | |
download | rails-546497d027f9e4e55e99dbf7b499bb091d6b5d24.tar.gz rails-546497d027f9e4e55e99dbf7b499bb091d6b5d24.tar.bz2 rails-546497d027f9e4e55e99dbf7b499bb091d6b5d24.zip |
Extract common controllers to abstract_unit
Diffstat (limited to 'actionpack/test/dispatch/routing')
-rw-r--r-- | actionpack/test/dispatch/routing/concerns_test.rb | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/actionpack/test/dispatch/routing/concerns_test.rb b/actionpack/test/dispatch/routing/concerns_test.rb index ab4ad6b72e..21da3bd77a 100644 --- a/actionpack/test/dispatch/routing/concerns_test.rb +++ b/actionpack/test/dispatch/routing/concerns_test.rb @@ -1,17 +1,5 @@ require 'abstract_unit' -class CommentsController < ActionController::Base - def index - head :ok - end -end - -class ImageAttachmentsController < ActionController::Base - def index - head :ok - end -end - class RoutingConcernsTest < ActionDispatch::IntegrationTest Routes = ActionDispatch::Routing::RouteSet.new.tap do |app| app.draw do @@ -20,7 +8,7 @@ class RoutingConcernsTest < ActionDispatch::IntegrationTest end concern :image_attachable do - resources :image_attachments, only: :index + resources :images, only: :index end resources :posts, concerns: [:commentable, :image_attachable] do @@ -65,13 +53,13 @@ class RoutingConcernsTest < ActionDispatch::IntegrationTest end def test_accessing_concern_from_resources_with_more_than_one_concern - get "/posts/1/image_attachments" + get "/posts/1/images" assert_equal "200", @response.code - assert_equal "/posts/1/image_attachments", post_image_attachments_path(post_id: 1) + assert_equal "/posts/1/images", post_images_path(post_id: 1) end def test_accessing_concern_from_resources_using_only_option - get "/posts/1/image_attachment/1" + get "/posts/1/image/1" assert_equal "404", @response.code end |