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
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)