1
0
Fork 0
mirror of https://github.com/activerecord-hackery/ransack.git synced 2022-11-09 13:47:45 -05:00

Add custom_arrows tests to form_helper_spec

This commit is contained in:
Garett Arrowood 2016-09-27 16:54:58 -04:00
parent 208a222436
commit 28dc9d1f5f

View file

@ -649,6 +649,52 @@ module Ransack
it { should match /Full Name ▼/ }
end
describe '#sort_link with config set with custom up_arrow' do
before do
Ransack.configure do |c|
c.custom_arrows = { up_arrow: "\u{1F446}" }
end
end
after do
#set back to default
Ransack.configure do |c|
c.custom_arrows = { up_arrow: "▼" }
end
end
subject { @controller.view_context
.sort_link(
[:main_app, Person.search(sorts: ['name desc'])],
:name,
controller: 'people',
hide_indicator: false
)
}
it { should match /Full Name \u{1F446}/ }
end
describe '#sort_link with config set with custom down_arrow' do
before do
Ransack.configure do |c|
c.custom_arrows = { down_arrow: "\u{1F447}" }
end
end
after do
#set back to default
Ransack.configure do |c|
c.custom_arrows = { down_arrow: "▲" }
end
end
subject { @controller.view_context
.sort_link(
[:main_app, Person.search(sorts: ['name asc'])],
:name,
controller: 'people',
hide_indicator: false
)
}
it { should match /Full Name \u{1F447}/ }
end
describe '#sort_link with config set to globally hide order indicators' do
before do
Ransack.configure { |c| c.hide_sort_order_indicators = true }