From: Andy Allan Date: Thu, 15 Sep 2016 10:06:37 +0000 (+0100) Subject: Add additional list items to ensure they are not selected X-Git-Tag: live~3853^2 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/516979b045f398b0c8ebb4f1cd3aaf57e8eca7a7?hp=d26f4074faf4fcc5ebb1b6a0928edf3aae9c2aee Add additional list items to ensure they are not selected The other list tests already have assetions showing the different lengths of lists. --- 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