]> git.openstreetmap.org Git - rails.git/blob - test/controllers/user_blocks/table_test_helper.rb
Add frozen_string_literal comments to ruby files
[rails.git] / test / controllers / user_blocks / table_test_helper.rb
1 # frozen_string_literal: true
2
3 module UserBlocks
4   module TableTestHelper
5     private
6
7     def check_user_blocks_table(user_blocks)
8       assert_dom "table#block_list tbody tr" do |rows|
9         assert_equal user_blocks.count, rows.count, "unexpected number of rows in user blocks table"
10         rows.zip(user_blocks).map do |row, user_block|
11           assert_dom row, "a[href='#{user_block_path user_block}']", 1
12         end
13       end
14     end
15
16     def check_no_page_link(name)
17       assert_select "a.page-link", { :text => /#{Regexp.quote(name)}/, :count => 0 }, "unexpected #{name} page link"
18     end
19
20     def check_page_link(name)
21       assert_select "a.page-link", { :text => /#{Regexp.quote(name)}/ }, "missing #{name} page link" do |buttons|
22         return buttons.first.attributes["href"].value
23       end
24     end
25   end
26 end