X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/5dfbf00776d5247a92cb36135d509fa0eb0b2730..98b1e5f76ce400af3270c3350804d40e30fd7d53:/test/controllers/diary_entries_controller_test.rb diff --git a/test/controllers/diary_entries_controller_test.rb b/test/controllers/diary_entries_controller_test.rb index b1e9b72f2..42d042645 100644 --- a/test/controllers/diary_entries_controller_test.rb +++ b/test/controllers/diary_entries_controller_test.rb @@ -325,7 +325,6 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest assert_select "p", :text => /#{new_body}/, :count => 1 assert_select "abbr[class='geo'][title='#{number_with_precision(new_latitude, :precision => 4)}; #{number_with_precision(new_longitude, :precision => 4)}']", :count => 1 # As we're not logged in, check that you cannot edit - # print @response.body assert_select "a[href='/user/#{ERB::Util.u(entry.user.display_name)}/diary/#{entry.id}/edit']", :text => "Edit this entry", :count => 1 end @@ -670,6 +669,11 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest assert_response :success assert_template :show + # Try a non-integer ID + assert_raise ActionController::RoutingError do + get "/user/#{CGI.escape(user.display_name)}/diary/#{diary_entry.id})" + end + # Try a deleted entry diary_entry_deleted = create(:diary_entry, :user => user, :visible => false) get diary_entry_path(:display_name => user.display_name, :id => diary_entry_deleted)