diff options
author | Matt Jankowski <mjankowski@thoughtbot.com> | 2017-04-14 21:09:55 -0400 |
---|---|---|
committer | Eugen <eugen@zeonfederated.com> | 2017-04-15 03:09:55 +0200 |
commit | 09540192c96d2ed35accf0b34f3acd9d04170727 (patch) | |
tree | c81ec35f2176631b10ae5a83abcdddfa417a5593 /spec/helpers/admin | |
parent | 08059ddda96496e5f3e257edbbecab43404faee7 (diff) |
Rename admin/accounts_helper to admin/filter_helper (#1816)
- Add some spec coverage for both methods - Add explicit constant call-outs for where the params are from
Diffstat (limited to 'spec/helpers/admin')
-rw-r--r-- | spec/helpers/admin/accounts_helper_spec.rb | 5 | ||||
-rw-r--r-- | spec/helpers/admin/filter_helper_spec.rb | 20 |
2 files changed, 20 insertions, 5 deletions
diff --git a/spec/helpers/admin/accounts_helper_spec.rb b/spec/helpers/admin/accounts_helper_spec.rb deleted file mode 100644 index b91f258b3..000000000 --- a/spec/helpers/admin/accounts_helper_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe Admin::AccountsHelper, type: :helper do - -end diff --git a/spec/helpers/admin/filter_helper_spec.rb b/spec/helpers/admin/filter_helper_spec.rb new file mode 100644 index 000000000..9d4ea2829 --- /dev/null +++ b/spec/helpers/admin/filter_helper_spec.rb @@ -0,0 +1,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 |