Commit c2595faa authored by Alex Ives's avatar Alex Ives

Match filter without case

parent 4a0fe52b
Pipeline #112092377 failed with stages
in 42 seconds
......@@ -21,7 +21,7 @@ def format_zones_json(zones, argument, time=Time.now)
time = time.utc
items = zones.select do |member, offset|
filter.empty? || member.include?(filter)
filter.empty? || member.match(/#{filter}/im)
end.map do |member, offset|
member_time = (time + offset * 60 * 60)
{
......
......@@ -53,7 +53,7 @@ describe 'format_zones_json' do
end
it 'filters to a single match' do
formatted = JSON.parse(format_zones_json(zones, 'Second', frozen_time))['items']
formatted = JSON.parse(format_zones_json(zones, 'second', frozen_time))['items']
expect(formatted.length).to eq(1)
expect(formatted[0]['title']).to match(/^.* - Second$/)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment