X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/7286ad027c7628adae872b51c3e7b1341781d3d4..fdb3a7a102f5c9c438542e6edcf042dbbfda2e07:/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 91e2a58d9..c96c433bf 100644 --- a/test/controllers/diary_entries_controller_test.rb +++ b/test/controllers/diary_entries_controller_test.rb @@ -159,8 +159,8 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest post diary_entries_path(:diary_entry => { :title => "New Title", :body => "This is a new body for the diary entry", :latitude => "1.1", :longitude => "2.2", :language_code => "en" }) end - assert_redirected_to :action => :index, :display_name => user.display_name entry = DiaryEntry.last + assert_redirected_to diary_entry_path(user, entry) assert_equal user.id, entry.user_id assert_equal "New Title", entry.title assert_equal "This is a new body for the diary entry", entry.body @@ -184,8 +184,8 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest post diary_entries_path(:diary_entry => { :title => "New Title", :body => "This is a new body for the diary entry", :latitude => "1.1", :longitude => "2.2", :language_code => "de" }) end - assert_redirected_to :action => :index, :display_name => user.display_name entry = DiaryEntry.last + assert_redirected_to diary_entry_path(user, entry) assert_equal user.id, entry.user_id assert_equal "New Title", entry.title assert_equal "This is a new body for the diary entry", entry.body @@ -211,8 +211,8 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest assert_difference "DiaryEntry.count", 1 do post diary_entries_path(:diary_entry => { :title => spammy_title, :body => spammy_body, :language_code => "en" }) end - assert_redirected_to :action => :index, :display_name => user.display_name entry = DiaryEntry.last + assert_redirected_to diary_entry_path(user, entry) assert_equal user.id, entry.user_id assert_equal spammy_title, entry.title assert_equal spammy_body, entry.body @@ -384,8 +384,8 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest def test_index_friends user = create(:user) other_user = create(:user) - friendship = create(:friendship, :befriender => user) - diary_entry = create(:diary_entry, :user => friendship.befriendee) + follow = create(:follow, :follower => user) + diary_entry = create(:diary_entry, :user => follow.following) _other_entry = create(:diary_entry, :user => other_user) # Try a list of diary entries for your friends when not logged in