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