]> git.openstreetmap.org Git - rails.git/blob - test/system/user_notes_test.rb
Add frozen_string_literal comments to ruby files
[rails.git] / test / system / user_notes_test.rb
1 # frozen_string_literal: true
2
3 require "application_system_test_case"
4
5 class UserNotesTest < ApplicationSystemTestCase
6   test "boundary condition when next page link activates" do
7     user = create(:user)
8     ("A".."J").each do |x|
9       create(:note, :author => user, :description => "Note '#{x}'") do |note|
10         create(:note_comment, :event => "opened", :note => note, :author => user, :body => "Note '#{x}'")
11       end
12     end
13
14     visit user_notes_path(user)
15
16     within_content_body do
17       assert_text "Note 'J'"
18       assert_text "Note 'A'"
19       assert_no_link "Previous"
20       assert_no_link "Next"
21     end
22
23     ("K".."K").each do |x|
24       create(:note, :author => user, :description => "Note '#{x}'") do |note|
25         create(:note_comment, :event => "opened", :note => note, :author => user, :body => "Note '#{x}'")
26       end
27     end
28
29     visit user_notes_path(user)
30
31     within_content_body do
32       assert_text "Note 'K'"
33       assert_text "Note 'B'"
34       assert_no_text "Note 'A'"
35       assert_no_link "Previous"
36       assert_link "Next"
37
38       click_on "Next", :match => :first
39
40       assert_no_text "Note 'K'"
41       assert_no_text "Note 'B'"
42       assert_text "Note 'A'"
43       assert_link "Previous"
44       assert_no_link "Next"
45     end
46   end
47 end