From 516979b045f398b0c8ebb4f1cd3aaf57e8eca7a7 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Thu, 15 Sep 2016 11:06:37 +0100 Subject: [PATCH] Add additional list items to ensure they are not selected The other list tests already have assetions showing the different lengths of lists. --- test/controllers/diary_entry_controller_test.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/controllers/diary_entry_controller_test.rb b/test/controllers/diary_entry_controller_test.rb index 7a92e5289..6e07a4091 100644 --- a/test/controllers/diary_entry_controller_test.rb +++ b/test/controllers/diary_entry_controller_test.rb @@ -404,8 +404,9 @@ class DiaryEntryControllerTest < ActionController::TestCase end def test_list_user - diary_entry = create(:diary_entry) - geo_entry = create(:diary_entry, :latitude => 51.50763, :longitude => -0.10781) + diary_entry = create(:diary_entry, :user_id => users(:normal_user).id) + geo_entry = create(:diary_entry, :user_id => users(:normal_user).id, :latitude => 51.50763, :longitude => -0.10781) + _other_entry = create(:diary_entry, :user_id => users(:public_user).id) # Try a list of diary entries for a valid user get :list, :display_name => users(:normal_user).display_name @@ -419,6 +420,7 @@ class DiaryEntryControllerTest < ActionController::TestCase def test_list_friends diary_entry = create(:diary_entry, :user_id => friends(:normal_user_with_second_user).friend_user_id) + _other_entry = create(:diary_entry, :user_id => users(:second_public_user).id) # Try a list of diary entries for your friends when not logged in get :list, :friends => true @@ -434,6 +436,7 @@ class DiaryEntryControllerTest < ActionController::TestCase def test_list_nearby diary_entry = create(:diary_entry, :user_id => users(:public_user).id) + # Try a list of diary entries for nearby users when not logged in get :list, :nearby => true assert_response :redirect -- 2.39.5