Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

ensure that collection responder works with uncountable mode name #55

Merged
merged 1 commit into from

3 participants

@nashby
Collaborator

add spec to ensure that collection responder works with uncountable mode name

related to #54

@josevalim josevalim merged commit 6f365bc into plataformatec:master
@rafaelfranca
Collaborator

lol. I was pressing the merge button.

@nashby
Collaborator

omg. super fast :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 27, 2012
  1. @nashby
This page is out of date. Refresh to see the latest.
Showing with 14 additions and 0 deletions.
  1. +10 −0 test/collection_responder_test.rb
  2. +4 −0 test/test_helper.rb
View
10 test/collection_responder_test.rb
@@ -30,6 +30,10 @@ def with_location
def isolated_namespace
respond_with MyEngine::Business.new
end
+
+ def uncountable
+ respond_with News.new
+ end
end
class CollectionResponderTest < ActionController::TestCase
@@ -69,4 +73,10 @@ def test_collection_respects_isolated_namespace
post :isolated_namespace
assert_redirected_to "businesses_url"
end
+
+ def test_collection_respects_uncountable_resource
+ @controller.expects(:news_index_url).returns("news_index_url")
+ post :uncountable
+ assert_redirected_to "news_index_url"
+ end
end
View
4 test/test_helper.rb
@@ -21,6 +21,7 @@
Responders::Routes = ActionDispatch::Routing::RouteSet.new
Responders::Routes.draw do
+ resources :news
match '/admin/:action', :controller => "admin/addresses"
match '/:controller(/:action(/:id))'
end
@@ -65,6 +66,9 @@ class Address < Model
class User < Model
end
+class News < Model
+end
+
module MyEngine
def self.use_relative_model_naming?
true
Something went wrong with that request. Please try again.