1 # frozen_string_literal: true
 
   3 require "application_system_test_case"
 
   5 class UserNotesTest < ApplicationSystemTestCase
 
   6   test "boundary condition when next page link activates" do
 
   9       create(:note, :author => user, :description => "Note '#{x}'") do |note|
 
  10         create(:note_comment, :event => "opened", :note => note, :author => user, :body => "Note '#{x}'")
 
  14     visit user_notes_path(user)
 
  16     within_content_body do
 
  17       assert_text "Note 'J'"
 
  18       assert_text "Note 'A'"
 
  19       assert_no_link "Previous"
 
  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}'")
 
  29     visit user_notes_path(user)
 
  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"
 
  38       click_on "Next", :match => :first
 
  40       assert_no_text "Note 'K'"
 
  41       assert_no_text "Note 'B'"
 
  42       assert_text "Note 'A'"
 
  43       assert_link "Previous"