Merge spectator's escape brackets commit for Rails 3-0-stable

It seems that rails 3-0-stable doesn't escape these elements in the
URL, whereas later versions of Rails do.
This commit is contained in:
jonatack 2013-05-25 01:05:39 +02:00
parent 9a5975f353
commit e13853b2cf
2 changed files with 4 additions and 4 deletions

View File

@ -50,7 +50,7 @@ module Ransack
describe '#sort_link' do
it 'sort_link for ransack attribute' do
sort_link = @f.sort_link :name, :controller => 'people'
sort_link.should match /people\?q%5Bs%5D=name\+asc/
sort_link.should match /people\?q(%5B|\[)s(%5D|\])=name\+asc/
sort_link.should match /sort_link/
sort_link.should match /Full Name<\/a>/
end

View File

@ -27,7 +27,7 @@ module Ransack
describe '#sort_link with default search_key' do
subject { @controller.view_context.sort_link([:main_app, Person.search(:sorts => ['name desc'])], :name, :controller => 'people') }
it { should match /people\?q%5Bs%5D=name\+asc/ }
it { should match /people\?q(%5B|\[)s(%5D|\])=name\+asc/ }
it { should match /sort_link desc/ }
it { should match /Full Name &#9660;/ }
end
@ -36,14 +36,14 @@ module Ransack
subject { @controller.view_context.sort_link(Person.search({:sorts => ['name desc']}, :search_key => :people_search),
:name, :controller => 'people') }
it { should match /people\?people_search%5Bs%5D=name\+asc/ }
it { should match /people\?people_search(%5B|\[)s(%5D|\])=name\+asc/ }
end
describe '#sort_link with default search_key defined as string' do
subject { @controller.view_context.sort_link(Person.search({:sorts => ['name desc']}, :search_key => 'people_search'),
:name, :controller => 'people') }
it { should match /people\?people_search%5Bs%5D=name\+asc/ }
it { should match /people\?people_search(%5B|\[)s(%5D|\])=name\+asc/ }
end
end
end