mirror of
https://github.com/activerecord-hackery/ransack.git
synced 2022-11-09 13:47:45 -05:00
Add test for #search_form_for with array of routes.
Follow-up to previous commit 83ce93b
to address issue #494.
This commit is contained in:
parent
83ce93b028
commit
b2f39920d2
1 changed files with 11 additions and 2 deletions
|
@ -6,8 +6,10 @@ module Ransack
|
|||
|
||||
router = ActionDispatch::Routing::RouteSet.new
|
||||
router.draw do
|
||||
resources :people
|
||||
resources :notes
|
||||
resources :people, :notes
|
||||
namespace :admin do
|
||||
resources :comments
|
||||
end
|
||||
get ':controller(/:action(/:id(.:format)))'
|
||||
end
|
||||
|
||||
|
@ -372,6 +374,13 @@ module Ransack
|
|||
it { should match /action="\/people.json"/ }
|
||||
end
|
||||
|
||||
describe '#search_form_for with an array of routes' do
|
||||
subject {
|
||||
@controller.view_context.search_form_for([:admin, Comment.search]) {}
|
||||
}
|
||||
it { should match /action="\/admin\/comments"/ }
|
||||
end
|
||||
|
||||
describe '#search_form_for with custom default search key' do
|
||||
before do
|
||||
Ransack.configure { |c| c.search_key = :example }
|
||||
|
|
Loading…
Reference in a new issue