From: Andy Allan Date: Thu, 9 Mar 2017 14:50:02 +0000 (+0000) Subject: Create a fresh user when requesting non-existent traces. X-Git-Tag: live~4052^2~1 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/18c25b620b1d393c84411f8c2d8695dea8e9902a Create a fresh user when requesting non-existent traces. --- diff --git a/test/controllers/trace_controller_test.rb b/test/controllers/trace_controller_test.rb index 908e4c89b..8390b6e67 100644 --- a/test/controllers/trace_controller_test.rb +++ b/test/controllers/trace_controller_test.rb @@ -323,12 +323,12 @@ class TraceControllerTest < ActionController::TestCase deleted_trace_file = create(:trace, :deleted) # First with no auth - get :view, :display_name => deleted_trace_file.user.display_name, :id => 0 + get :view, :display_name => create(:user).display_name, :id => 0 assert_response :redirect assert_redirected_to :action => :list # Now with some other user - get :view, { :display_name => deleted_trace_file.user.display_name, :id => 0 }, { :user => create(:user) } + get :view, { :display_name => create(:user).display_name, :id => 0 }, { :user => create(:user) } assert_response :redirect assert_redirected_to :action => :list @@ -394,11 +394,11 @@ class TraceControllerTest < ActionController::TestCase deleted_trace_file = create(:trace, :deleted) # First with no auth and a trace that has never existed - get :data, :display_name => deleted_trace_file.user.display_name, :id => 0 + get :data, :display_name => create(:user).display_name, :id => 0 assert_response :not_found # Now with a trace that has never existed - get :data, { :display_name => deleted_trace_file.user.display_name, :id => 0 }, { :user => deleted_trace_file.user } + get :data, { :display_name => create(:user).display_name, :id => 0 }, { :user => deleted_trace_file.user } assert_response :not_found # Now with a trace that has been deleted