+ first_user = create(:user)
+ second_user = create(:user)
+ moderator_user = create(:moderator_user)
+
+ create(:note) do |note|
+ create(:note_comment, :note => note, :author => first_user)
+ end
+ create(:note) do |note|
+ create(:note_comment, :note => note, :author => second_user)
+ end
+ create(:note, :status => "hidden") do |note|
+ create(:note_comment, :note => note, :author => second_user)
+ end
+
+ # Note that the table rows include a header row
+ get :mine, :params => { :display_name => first_user.display_name }
+ assert_response :success
+ assert_select "table.note_list tr", :count => 2
+
+ get :mine, :params => { :display_name => second_user.display_name }
+ assert_response :success
+ assert_select "table.note_list tr", :count => 2
+
+ get :mine, :params => { :display_name => "non-existent" }
+ assert_response :not_found
+
+ session[:user] = moderator_user.id
+
+ get :mine, :params => { :display_name => first_user.display_name }