X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/11e97b3edb057f6f449209ca2afd169feda229a4..bc12774c21915687c07b93dbcbef78d28d2920af:/test/controllers/diary_entries_controller_test.rb?ds=inline diff --git a/test/controllers/diary_entries_controller_test.rb b/test/controllers/diary_entries_controller_test.rb index 868171752..255b43997 100644 --- a/test/controllers/diary_entries_controller_test.rb +++ b/test/controllers/diary_entries_controller_test.rb @@ -113,7 +113,7 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest # are not logged in get new_diary_entry_path assert_response :redirect - assert_redirected_to :controller => :users, :action => :login, :referer => "/diary/new" + assert_redirected_to login_path(:referer => "/diary/new") end def test_new_form @@ -257,7 +257,7 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest # not logged in, without and with the id of the entry you want to edit get edit_diary_entry_path(:display_name => entry.user.display_name, :id => entry) assert_response :redirect - assert_redirected_to :controller => :users, :action => :login, :referer => "/user/#{ERB::Util.u(entry.user.display_name)}/diary/#{entry.id}/edit" + assert_redirected_to login_path(:referer => "/user/#{ERB::Util.u(entry.user.display_name)}/diary/#{entry.id}/edit") session_for(other_user) @@ -506,7 +506,7 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest # Try a list of diary entries for your friends when not logged in get friends_diary_entries_path assert_response :redirect - assert_redirected_to :controller => :users, :action => :login, :referer => "/diary/friends" + assert_redirected_to login_path(:referer => "/diary/friends") # Try a list of diary entries for your friends when logged in session_for(user) @@ -526,7 +526,7 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest # Try a list of diary entries for nearby users when not logged in get nearby_diary_entries_path assert_response :redirect - assert_redirected_to :controller => :users, :action => :login, :referer => "/diary/nearby" + assert_redirected_to login_path(:referer => "/diary/nearby") # Try a list of diary entries for nearby users when logged in session_for(nearby_user) @@ -848,9 +848,7 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest get diary_comments_path(:display_name => user.display_name) assert_response :success assert_template :comments - assert_select "table.table-striped" do - assert_select "tr", :count => 1 # header, no comments - end + assert_select "h4", :html => "No diary comments" # Test a user with a comment create(:diary_comment, :user => other_user)