# are not logged in
get :new
assert_response :redirect
- assert_redirected_to :controller => :user, :action => :login, :referer => "/diary/new"
+ assert_redirected_to :controller => :users, :action => :login, :referer => "/diary/new"
end
def test_new_form
:params => { :display_name => user.display_name },
:session => { :user => user }
assert_response :redirect
- assert_redirected_to :controller => :user, :action => :suspended
+ assert_redirected_to :controller => :users, :action => :suspended
end
def test_edit
get :edit,
:params => { :display_name => entry.user.display_name, :id => entry.id }
assert_response :redirect
- assert_redirected_to :controller => :user, :action => :login, :referer => "/user/#{ERB::Util.u(entry.user.display_name)}/diary/#{entry.id}/edit"
+ assert_redirected_to :controller => :users, :action => :login, :referer => "/user/#{ERB::Util.u(entry.user.display_name)}/diary/#{entry.id}/edit"
# Verify that you get a not found error, when you pass a bogus id
get :edit,
email = ActionMailer::Base.deliveries.first
assert_equal [user.email], email.to
assert_equal "[OpenStreetMap] #{other_user.display_name} commented on a diary entry", email.subject
- assert_match /New comment/, email.text_part.decoded
- assert_match /New comment/, email.html_part.decoded
+ assert_match(/New comment/, email.text_part.decoded)
+ assert_match(/New comment/, email.html_part.decoded)
ActionMailer::Base.deliveries.clear
comment = DiaryComment.order(:id).last
assert_equal entry.id, comment.diary_entry_id
:params => { :display_name => user.display_name },
:session => { :user => other_user }
assert_response :redirect
- assert_redirected_to :controller => :user, :action => :suspended
+ assert_redirected_to :controller => :users, :action => :suspended
# Now show the diary entry, and check the new comment is not present
get :show,
# Try a list of diary entries for an invalid user
get :index, :params => { :display_name => "No Such User" }
assert_response :not_found
- assert_template "user/no_such_user"
+ assert_template "users/no_such_user"
end
def test_index_friends
# Try a list of diary entries for your friends when not logged in
get :index, :params => { :friends => true }
assert_response :redirect
- assert_redirected_to :controller => :user, :action => :login, :referer => "/diary/friends"
+ assert_redirected_to :controller => :users, :action => :login, :referer => "/diary/friends"
# Try a list of diary entries for your friends when logged in
get :index, :params => { :friends => true }, :session => { :user => user }
# Try a list of diary entries for nearby users when not logged in
get :index, :params => { :nearby => true }
assert_response :redirect
- assert_redirected_to :controller => :user, :action => :login, :referer => "/diary/nearby"
+ assert_redirected_to :controller => :users, :action => :login, :referer => "/diary/nearby"
# Try a list of diary entries for nearby users when logged in
get :index, :params => { :nearby => true }, :session => { :user => nearby_user }