about summary refs log tree commit diff
path: root/spec/helpers/admin/filter_helper_spec.rb
blob: 9d4ea28294654251a50a50050d0476752c9e477f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'rails_helper'

describe Admin::FilterHelper do
  it 'Uses filter_link_to to create filter links' do
    params = ActionController::Parameters.new(
      { test: 'test' }
    )
    allow(helper).to receive(:params).and_return(params)
    allow(helper).to receive(:url_for).and_return('/test')
    result = helper.filter_link_to('text', { resolved: true })

    expect(result).to match(/text/)
  end

  it 'Uses table_link_to to create icon links' do
    result = helper.table_link_to 'icon', 'text', 'path'

    expect(result).to match(/text/)
  end
end