From 3ec67ea2d395f9ae78f806f8e583e10d691861de Mon Sep 17 00:00:00 2001
From: Andy Allan
Date: Wed, 3 Oct 2018 15:31:10 +0200
Subject: [PATCH] Rename user_controller to users_controller
---
.rubocop.yml | 2 +-
.rubocop_todo.yml | 6 +-
app/controllers/application_controller.rb | 12 +-
app/controllers/messages_controller.rb | 4 +-
app/controllers/notes_controller.rb | 4 +-
...user_controller.rb => users_controller.rb} | 80 ++++++------
app/helpers/changeset_helper.rb | 2 +-
app/helpers/note_helper.rb | 4 +-
app/helpers/user_helper.rb | 6 +-
app/helpers/user_roles_helper.rb | 12 +-
app/models/notifier.rb | 8 +-
app/views/browse/changeset.html.erb | 2 +-
app/views/changeset/_user.atom.builder | 2 +-
app/views/diary_entry/show.html.erb | 2 +-
app/views/layouts/_header.html.erb | 6 +-
app/views/{user => users}/_api_user.builder | 0
.../_auth_association.html.erb | 0
app/views/{user => users}/_contact.html.erb | 6 +-
app/views/{user => users}/_popup.html.erb | 0
app/views/{user => users}/_terms.html.erb | 0
app/views/{user => users}/_user.html.erb | 4 +-
app/views/{user => users}/account.html.erb | 10 +-
app/views/{user => users}/api_read.builder | 0
app/views/{user => users}/api_users.builder | 0
app/views/{user => users}/blocked.html.erb | 0
app/views/{user => users}/confirm.html.erb | 0
.../{user => users}/confirm_email.html.erb | 0
app/views/{user => users}/index.html.erb | 0
app/views/{user => users}/login.html.erb | 4 +-
app/views/{user => users}/logout.html.erb | 0
.../{user => users}/lost_password.html.erb | 0
.../{user => users}/make_friend.html.erb | 0
app/views/{user => users}/new.html.erb | 0
.../{user => users}/no_such_user.html.erb | 0
.../{user => users}/remove_friend.html.erb | 0
.../{user => users}/reset_password.html.erb | 0
app/views/{user => users}/show.html.erb | 4 +-
app/views/{user => users}/suspended.html.erb | 0
app/views/{user => users}/terms.html.erb | 0
config/locales/en.yml | 2 +-
config/routes.rb | 58 ++++-----
test/controllers/changeset_controller_test.rb | 8 +-
.../diary_entry_controller_test.rb | 14 +--
test/controllers/messages_controller_test.rb | 2 +-
test/controllers/site_controller_test.rb | 4 +-
test/controllers/traces_controller_test.rb | 8 +-
.../user_blocks_controller_test.rb | 12 +-
.../controllers/user_roles_controller_test.rb | 4 +-
...oller_test.rb => users_controller_test.rb} | 88 ++++++-------
test/integration/client_applications_test.rb | 6 +-
.../user_changeset_comments_test.rb | 2 +-
test/integration/user_creation_test.rb | 60 ++++-----
test/integration/user_diaries_test.rb | 2 +-
test/integration/user_login_test.rb | 118 +++++++++---------
test/integration/user_roles_test.rb | 4 +-
test/integration/user_terms_seen_test.rb | 12 +-
test/system/issues_test.rb | 2 +-
test/system/report_user_test.rb | 8 +-
58 files changed, 297 insertions(+), 297 deletions(-)
rename app/controllers/{user_controller.rb => users_controller.rb} (90%)
rename app/views/{user => users}/_api_user.builder (100%)
rename app/views/{user => users}/_auth_association.html.erb (100%)
rename app/views/{user => users}/_contact.html.erb (80%)
rename app/views/{user => users}/_popup.html.erb (100%)
rename app/views/{user => users}/_terms.html.erb (100%)
rename app/views/{user => users}/_user.html.erb (89%)
rename app/views/{user => users}/account.html.erb (94%)
rename app/views/{user => users}/api_read.builder (100%)
rename app/views/{user => users}/api_users.builder (100%)
rename app/views/{user => users}/blocked.html.erb (100%)
rename app/views/{user => users}/confirm.html.erb (100%)
rename app/views/{user => users}/confirm_email.html.erb (100%)
rename app/views/{user => users}/index.html.erb (100%)
rename app/views/{user => users}/login.html.erb (94%)
rename app/views/{user => users}/logout.html.erb (100%)
rename app/views/{user => users}/lost_password.html.erb (100%)
rename app/views/{user => users}/make_friend.html.erb (100%)
rename app/views/{user => users}/new.html.erb (100%)
rename app/views/{user => users}/no_such_user.html.erb (100%)
rename app/views/{user => users}/remove_friend.html.erb (100%)
rename app/views/{user => users}/reset_password.html.erb (100%)
rename app/views/{user => users}/show.html.erb (97%)
rename app/views/{user => users}/suspended.html.erb (100%)
rename app/views/{user => users}/terms.html.erb (100%)
rename test/controllers/{user_controller_test.rb => users_controller_test.rb} (95%)
diff --git a/.rubocop.yml b/.rubocop.yml
index 31c14773c..abf25d3cd 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -45,7 +45,7 @@ Rails/InverseOf:
Rails/SkipsModelValidations:
Exclude:
- 'db/migrate/*.rb'
- - 'app/controllers/user_controller.rb'
+ - 'app/controllers/users_controller.rb'
Style/BracesAroundHashParameters:
EnforcedStyle: context_dependent
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 293135907..00851ffcc 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -14,7 +14,7 @@ Lint/AssignmentInCondition:
- 'app/controllers/geocoder_controller.rb'
- 'app/controllers/notes_controller.rb'
- 'app/controllers/traces_controller.rb'
- - 'app/controllers/user_controller.rb'
+ - 'app/controllers/users_controller.rb'
- 'app/controllers/user_preferences_controller.rb'
- 'app/helpers/application_helper.rb'
- 'app/helpers/browse_helper.rb'
@@ -28,7 +28,7 @@ Lint/AssignmentInCondition:
Lint/HandleExceptions:
Exclude:
- 'app/controllers/amf_controller.rb'
- - 'app/controllers/user_controller.rb'
+ - 'app/controllers/users_controller.rb'
# Offense count: 692
Metrics/AbcSize:
@@ -139,7 +139,7 @@ Rails/NotNullColumn:
# Offense count: 20
Rails/OutputSafety:
Exclude:
- - 'app/controllers/user_controller.rb'
+ - 'app/controllers/users_controller.rb'
- 'app/helpers/application_helper.rb'
- 'app/helpers/changeset_helper.rb'
- 'app/helpers/geocoder_helper.rb'
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index f35493b26..bd1995014 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -17,16 +17,16 @@ class ApplicationController < ActionController::Base
session.delete(:user)
session_expires_automatically
- redirect_to :controller => "user", :action => "suspended"
+ redirect_to :controller => "users", :action => "suspended"
# don't allow access to any auth-requiring part of the site unless
# the new CTs have been seen (and accept/decline chosen).
elsif !current_user.terms_seen && flash[:skip_terms].nil?
flash[:notice] = t "user.terms.you need to accept or decline"
if params[:referer]
- redirect_to :controller => "user", :action => "terms", :referer => params[:referer]
+ redirect_to :controller => "users", :action => "terms", :referer => params[:referer]
else
- redirect_to :controller => "user", :action => "terms", :referer => request.fullpath
+ redirect_to :controller => "users", :action => "terms", :referer => request.fullpath
end
end
elsif session[:token]
@@ -41,7 +41,7 @@ class ApplicationController < ActionController::Base
def require_user
unless current_user
if request.get?
- redirect_to :controller => "user", :action => "login", :referer => request.fullpath
+ redirect_to :controller => "users", :action => "login", :referer => request.fullpath
else
head :forbidden
end
@@ -386,11 +386,11 @@ class ApplicationController < ActionController::Base
##
# render a "no such user" page
def render_unknown_user(name)
- @title = t "user.no_such_user.title"
+ @title = t "users.no_such_user.title"
@not_found_user = name
respond_to do |format|
- format.html { render :template => "user/no_such_user", :status => :not_found }
+ format.html { render :template => "users/no_such_user", :status => :not_found }
format.all { head :not_found }
end
end
diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb
index 54850d403..cebf5d95b 100644
--- a/app/controllers/messages_controller.rb
+++ b/app/controllers/messages_controller.rb
@@ -54,7 +54,7 @@ class MessagesController < ApplicationController
render :action => "new"
else
flash[:notice] = t ".wrong_user", :user => current_user.display_name
- redirect_to :controller => "user", :action => "login", :referer => request.fullpath
+ redirect_to :controller => "users", :action => "login", :referer => request.fullpath
end
rescue ActiveRecord::RecordNotFound
@title = t "messages.no_such_message.title"
@@ -71,7 +71,7 @@ class MessagesController < ApplicationController
@message.save
else
flash[:notice] = t ".wrong_user", :user => current_user.display_name
- redirect_to :controller => "user", :action => "login", :referer => request.fullpath
+ redirect_to :controller => "users", :action => "login", :referer => request.fullpath
end
rescue ActiveRecord::RecordNotFound
@title = t "messages.no_such_message.title"
diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb
index 19ff725dc..fc7a9e3c7 100644
--- a/app/controllers/notes_controller.rb
+++ b/app/controllers/notes_controller.rb
@@ -289,10 +289,10 @@ class NotesController < ApplicationController
@notes = @notes.visible unless current_user&.moderator?
@notes = @notes.order("updated_at DESC, id").distinct.offset((@page - 1) * @page_size).limit(@page_size).preload(:comments => :author).to_a
else
- @title = t "user.no_such_user.title"
+ @title = t "users.no_such_user.title"
@not_found_user = params[:display_name]
- render :template => "user/no_such_user", :status => :not_found
+ render :template => "users/no_such_user", :status => :not_found
end
end
end
diff --git a/app/controllers/user_controller.rb b/app/controllers/users_controller.rb
similarity index 90%
rename from app/controllers/user_controller.rb
rename to app/controllers/users_controller.rb
index 78299dccf..d18cf188c 100644
--- a/app/controllers/user_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1,4 +1,4 @@
-class UserController < ApplicationController
+class UsersController < ApplicationController
layout "site", :except => [:api_details]
skip_before_action :verify_authenticity_token, :only => [:api_read, :api_users, :api_details, :api_gpx_files, :auth_success]
@@ -27,7 +27,7 @@ class UserController < ApplicationController
if request.xhr?
render :partial => "terms"
else
- @title = t "user.terms.title"
+ @title = t "users.terms.title"
if current_user&.terms_agreed?
# Already agreed to terms, so just show settings
@@ -39,13 +39,13 @@ class UserController < ApplicationController
end
def save
- @title = t "user.new.title"
+ @title = t "users.new.title"
if params[:decline]
if current_user
current_user.terms_seen = true
- flash[:notice] = t("user.new.terms declined", :url => t("user.new.terms declined url")).html_safe if current_user.save
+ flash[:notice] = t("users.new.terms declined", :url => t("users.new.terms declined url")).html_safe if current_user.save
if params[:referer]
redirect_to params[:referer]
@@ -53,7 +53,7 @@ class UserController < ApplicationController
redirect_to :action => :account, :display_name => current_user.display_name
end
else
- redirect_to t("user.terms.declined")
+ redirect_to t("users.terms.declined")
end
elsif current_user
unless current_user.terms_agreed?
@@ -61,7 +61,7 @@ class UserController < ApplicationController
current_user.terms_agreed = Time.now.getutc
current_user.terms_seen = true
- flash[:notice] = t "user.new.terms accepted" if current_user.save
+ flash[:notice] = t "users.new.terms accepted" if current_user.save
end
if params[:referer]
@@ -134,18 +134,18 @@ class UserController < ApplicationController
current_user.errors.add(attribute, error)
end
end
- @title = t "user.account.title"
+ @title = t "users.account.title"
end
def go_public
current_user.data_public = true
current_user.save
- flash[:notice] = t "user.go_public.flash success"
+ flash[:notice] = t "users.go_public.flash success"
redirect_to :action => "account", :display_name => current_user.display_name
end
def lost_password
- @title = t "user.lost_password.title"
+ @title = t "users.lost_password.title"
if params[:user] && params[:user][:email]
user = User.visible.find_by(:email => params[:user][:email])
@@ -159,16 +159,16 @@ class UserController < ApplicationController
if user
token = user.tokens.create
Notifier.lost_password(user, token).deliver_now
- flash[:notice] = t "user.lost_password.notice email on way"
+ flash[:notice] = t "users.lost_password.notice email on way"
redirect_to :action => "login"
else
- flash.now[:error] = t "user.lost_password.notice email cannot find"
+ flash.now[:error] = t "users.lost_password.notice email cannot find"
end
end
end
def reset_password
- @title = t "user.reset_password.title"
+ @title = t "users.reset_password.title"
if params[:token]
token = UserToken.find_by(:token => params[:token])
@@ -184,12 +184,12 @@ class UserController < ApplicationController
if current_user.save
token.destroy
- flash[:notice] = t "user.reset_password.flash changed"
+ flash[:notice] = t "users.reset_password.flash changed"
successful_login(current_user)
end
end
else
- flash[:error] = t "user.reset_password.flash token bad"
+ flash[:error] = t "users.reset_password.flash token bad"
redirect_to :action => "lost_password"
end
else
@@ -198,7 +198,7 @@ class UserController < ApplicationController
end
def new
- @title = t "user.new.title"
+ @title = t "users.new.title"
@referer = params[:referer] || session[:referer]
append_content_security_policy_directives(
@@ -271,7 +271,7 @@ class UserController < ApplicationController
end
def logout
- @title = t "user.logout.title"
+ @title = t "users.logout.title"
if params[:session] == session.id
if session[:token]
@@ -293,10 +293,10 @@ class UserController < ApplicationController
if request.post?
token = UserToken.find_by(:token => params[:confirm_string])
if token&.user&.active?
- flash[:error] = t("user.confirm.already active")
+ flash[:error] = t("users.confirm.already active")
redirect_to :action => "login"
elsif !token || token.expired?
- flash[:error] = t("user.confirm.unknown token")
+ flash[:error] = t("users.confirm.unknown token")
redirect_to :action => "confirm"
else
user = token.user
@@ -315,7 +315,7 @@ class UserController < ApplicationController
end
if token.nil? || token.user != user
- flash[:notice] = t("user.confirm.success")
+ flash[:notice] = t("users.confirm.success")
redirect_to :action => :login, :referer => referer
else
token.destroy
@@ -337,10 +337,10 @@ class UserController < ApplicationController
token = UserToken.find_by(:token => session[:token])
if user.nil? || token.nil? || token.user != user
- flash[:error] = t "user.confirm_resend.failure", :name => params[:display_name]
+ flash[:error] = t "users.confirm_resend.failure", :name => params[:display_name]
else
Notifier.signup_confirm(user, user.tokens.create).deliver_now
- flash[:notice] = t("user.confirm_resend.success", :email => user.email, :sender => SUPPORT_EMAIL).html_safe
+ flash[:notice] = t("users.confirm_resend.success", :email => user.email, :sender => SUPPORT_EMAIL).html_safe
end
redirect_to :action => "login"
@@ -357,9 +357,9 @@ class UserController < ApplicationController
gravatar_enabled = gravatar_enable(current_user)
if current_user.save
flash[:notice] = if gravatar_enabled
- t("user.confirm_email.success") + " " + gravatar_status_message(current_user)
+ t("users.confirm_email.success") + " " + gravatar_status_message(current_user)
else
- t("user.confirm_email.success")
+ t("users.confirm_email.success")
end
else
flash[:errors] = current_user.errors
@@ -368,10 +368,10 @@ class UserController < ApplicationController
session[:user] = current_user.id
redirect_to :action => "account", :display_name => current_user.display_name
elsif token
- flash[:error] = t "user.confirm_email.failure"
+ flash[:error] = t "users.confirm_email.failure"
redirect_to :action => "account", :display_name => token.user.display_name
else
- flash[:error] = t "user.confirm_email.unknown_token"
+ flash[:error] = t "users.confirm_email.unknown_token"
end
end
end
@@ -429,12 +429,12 @@ class UserController < ApplicationController
friend.befriender = current_user
friend.befriendee = @new_friend
if current_user.is_friends_with?(@new_friend)
- flash[:warning] = t "user.make_friend.already_a_friend", :name => @new_friend.display_name
+ flash[:warning] = t "users.make_friend.already_a_friend", :name => @new_friend.display_name
elsif friend.save
- flash[:notice] = t "user.make_friend.success", :name => @new_friend.display_name
+ flash[:notice] = t "users.make_friend.success", :name => @new_friend.display_name
Notifier.friend_notification(friend).deliver_now
else
- friend.add_error(t("user.make_friend.failed", :name => @new_friend.display_name))
+ friend.add_error(t("users.make_friend.failed", :name => @new_friend.display_name))
end
if params[:referer]
@@ -455,9 +455,9 @@ class UserController < ApplicationController
if request.post?
if current_user.is_friends_with?(@friend)
Friend.where(:user_id => current_user.id, :friend_user_id => @friend.id).delete_all
- flash[:notice] = t "user.remove_friend.success", :name => @friend.display_name
+ flash[:notice] = t "users.remove_friend.success", :name => @friend.display_name
else
- flash[:error] = t "user.remove_friend.not_a_friend", :name => @friend.display_name
+ flash[:error] = t "users.remove_friend.not_a_friend", :name => @friend.display_name
end
if params[:referer]
@@ -562,9 +562,9 @@ class UserController < ApplicationController
when "active", "confirmed" then
successful_login(user, request.env["omniauth.params"]["referer"])
when "suspended" then
- failed_login t("user.login.account is suspended", :webmaster => "mailto:#{SUPPORT_EMAIL}").html_safe
+ failed_login t("users.login.account is suspended", :webmaster => "mailto:#{SUPPORT_EMAIL}").html_safe
else
- failed_login t("user.login.auth failure")
+ failed_login t("users.login.auth failure")
end
else
redirect_to :action => "new", :nickname => name, :email => email,
@@ -576,7 +576,7 @@ class UserController < ApplicationController
##
# omniauth failure callback
def auth_failure
- flash[:error] = t("user.auth_failure." + params[:message])
+ flash[:error] = t("users.auth_failure." + params[:message])
redirect_to params[:origin] || login_url
end
@@ -590,9 +590,9 @@ class UserController < ApplicationController
elsif user = User.authenticate(:username => username, :password => password, :pending => true)
unconfirmed_login(user)
elsif User.authenticate(:username => username, :password => password, :suspended => true)
- failed_login t("user.login.account is suspended", :webmaster => "mailto:#{SUPPORT_EMAIL}").html_safe, username
+ failed_login t("users.login.account is suspended", :webmaster => "mailto:#{SUPPORT_EMAIL}").html_safe, username
else
- failed_login t("user.login.auth failure"), username
+ failed_login t("users.login.auth failure"), username
end
end
@@ -727,12 +727,12 @@ class UserController < ApplicationController
set_locale(true)
if user.new_email.blank? || user.new_email == user.email
- flash.now[:notice] = t "user.account.flash update success"
+ flash.now[:notice] = t "users.account.flash update success"
else
user.email = user.new_email
if user.valid?
- flash.now[:notice] = t "user.account.flash update success confirm needed"
+ flash.now[:notice] = t "users.account.flash update success confirm needed"
begin
Notifier.email_confirm(user, user.tokens.create).deliver_now
@@ -754,7 +754,7 @@ class UserController < ApplicationController
# and return them to the user page.
def require_administrator
if current_user && !current_user.administrator?
- flash[:error] = t("user.filter.not_an_administrator")
+ flash[:error] = t("users.filter.not_an_administrator")
if params[:display_name]
redirect_to user_path(:display_name => params[:display_name])
@@ -839,9 +839,9 @@ class UserController < ApplicationController
# display a message about th current status of the gravatar setting
def gravatar_status_message(user)
if user.image_use_gravatar
- t "user.account.gravatar.enabled"
+ t "users.account.gravatar.enabled"
else
- t "user.account.gravatar.disabled"
+ t "users.account.gravatar.disabled"
end
end
end
diff --git a/app/helpers/changeset_helper.rb b/app/helpers/changeset_helper.rb
index bc19bc857..9bcae4ad4 100644
--- a/app/helpers/changeset_helper.rb
+++ b/app/helpers/changeset_helper.rb
@@ -1,7 +1,7 @@
module ChangesetHelper
def changeset_user_link(changeset)
if changeset.user.status == "deleted"
- t("user.no_such_user.deleted")
+ t("users.no_such_user.deleted")
elsif changeset.user.data_public?
link_to(changeset.user.display_name, user_path(changeset.user))
else
diff --git a/app/helpers/note_helper.rb b/app/helpers/note_helper.rb
index efe2346c9..89c8cc376 100644
--- a/app/helpers/note_helper.rb
+++ b/app/helpers/note_helper.rb
@@ -16,9 +16,9 @@ module NoteHelper
if author.nil?
""
elsif author.status == "deleted"
- t("user.no_such_user.deleted")
+ t("users.no_such_user.deleted")
else
- link_to h(author.display_name), link_options.merge(:controller => "user", :action => "show", :display_name => author.display_name)
+ link_to h(author.display_name), link_options.merge(:controller => "users", :action => "show", :display_name => author.display_name)
end
end
end
diff --git a/app/helpers/user_helper.rb b/app/helpers/user_helper.rb
index 065a562c4..1fc8e3ed2 100644
--- a/app/helpers/user_helper.rb
+++ b/app/helpers/user_helper.rb
@@ -45,15 +45,15 @@ module UserHelper
# External authentication support
def openid_logo
- image_tag "openid_small.png", :alt => t("user.login.openid_logo_alt"), :class => "openid_logo"
+ image_tag "openid_small.png", :alt => t("users.login.openid_logo_alt"), :class => "openid_logo"
end
def auth_button(name, provider, options = {})
link_to(
- image_tag("#{name}.png", :alt => t("user.login.auth_providers.#{name}.alt")),
+ image_tag("#{name}.png", :alt => t("users.login.auth_providers.#{name}.alt")),
auth_path(options.merge(:provider => provider)),
:class => "auth_button",
- :title => t("user.login.auth_providers.#{name}.title")
+ :title => t("users.login.auth_providers.#{name}.title")
)
end
diff --git a/app/helpers/user_roles_helper.rb b/app/helpers/user_roles_helper.rb
index 0b7e9c616..b9430535e 100644
--- a/app/helpers/user_roles_helper.rb
+++ b/app/helpers/user_roles_helper.rb
@@ -9,21 +9,21 @@ module UserRolesHelper
if current_user&.administrator?
if user.has_role?(role)
image = "roles/#{role}"
- alt = t("user.show.role.revoke.#{role}")
- title = t("user.show.role.revoke.#{role}")
+ alt = t("users.show.role.revoke.#{role}")
+ title = t("users.show.role.revoke.#{role}")
url = revoke_role_path(:display_name => user.display_name, :role => role)
confirm = t("user_role.revoke.are_you_sure", :name => user.display_name, :role => role)
else
image = "roles/blank_#{role}"
- alt = t("user.show.role.grant.#{role}")
- title = t("user.show.role.grant.#{role}")
+ alt = t("users.show.role.grant.#{role}")
+ title = t("users.show.role.grant.#{role}")
url = grant_role_path(:display_name => user.display_name, :role => role)
confirm = t("user_role.grant.are_you_sure", :name => user.display_name, :role => role)
end
elsif user.has_role?(role)
image = "roles/#{role}"
- alt = t("user.show.role.#{role}")
- title = t("user.show.role.#{role}")
+ alt = t("users.show.role.#{role}")
+ title = t("users.show.role.#{role}")
end
if image
diff --git a/app/models/notifier.rb b/app/models/notifier.rb
index 3cc1be1e6..2ff9c85d7 100644
--- a/app/models/notifier.rb
+++ b/app/models/notifier.rb
@@ -8,7 +8,7 @@ class Notifier < ActionMailer::Base
def signup_confirm(user, token)
with_recipient_locale user do
- @url = url_for(:controller => "user", :action => "confirm",
+ @url = url_for(:controller => "users", :action => "confirm",
:display_name => user.display_name,
:confirm_string => token.token)
@@ -20,7 +20,7 @@ class Notifier < ActionMailer::Base
def email_confirm(user, token)
with_recipient_locale user do
@address = user.new_email
- @url = url_for(:controller => "user", :action => "confirm_email",
+ @url = url_for(:controller => "users", :action => "confirm_email",
:confirm_string => token.token)
mail :to => user.new_email,
@@ -30,7 +30,7 @@ class Notifier < ActionMailer::Base
def lost_password(user, token)
with_recipient_locale user do
- @url = url_for(:controller => "user", :action => "reset_password",
+ @url = url_for(:controller => "users", :action => "reset_password",
:token => token.token)
mail :to => user.email,
@@ -105,7 +105,7 @@ class Notifier < ActionMailer::Base
with_recipient_locale friend.befriendee do
@friend = friend
@viewurl = user_url(@friend.befriender)
- @friendurl = url_for(:controller => "user", :action => "make_friend",
+ @friendurl = url_for(:controller => "users", :action => "make_friend",
:display_name => @friend.befriender.display_name)
@author = @friend.befriender.display_name
diff --git a/app/views/browse/changeset.html.erb b/app/views/browse/changeset.html.erb
index 545b6d072..81e930812 100644
--- a/app/views/browse/changeset.html.erb
+++ b/app/views/browse/changeset.html.erb
@@ -63,7 +63,7 @@
<% unless current_user %>
- <%= link_to(t(".join_discussion"), :controller => 'user', :action => 'login', :referer => request.fullpath) %>
+ <%= link_to(t(".join_discussion"), :controller => 'users', :action => 'login', :referer => request.fullpath) %>
<% end %>
diff --git a/app/views/changeset/_user.atom.builder b/app/views/changeset/_user.atom.builder
index 61faea97f..7aa65d2c3 100644
--- a/app/views/changeset/_user.atom.builder
+++ b/app/views/changeset/_user.atom.builder
@@ -1 +1 @@
-xml.a(user.display_name, :href => url_for(:controller => "user", :action => "view", :display_name => user.display_name))
+xml.a(user.display_name, :href => url_for(:controller => "users", :action => "view", :display_name => user.display_name))
diff --git a/app/views/diary_entry/show.html.erb b/app/views/diary_entry/show.html.erb
index 754070e52..02bebc5bc 100644
--- a/app/views/diary_entry/show.html.erb
+++ b/app/views/diary_entry/show.html.erb
@@ -30,7 +30,7 @@
<%= link_to t('javascripts.changesets.show.subscribe'), diary_entry_subscribe_path(:display_name => @entry.user.display_name, :id => @entry.id), :method => :post, :class => :button %>
<% end %>
<% else %>
-
+
<% end %>
diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb
index cd3dfd468..e17c6a77b 100644
--- a/app/views/layouts/_header.html.erb
+++ b/app/views/layouts/_header.html.erb
@@ -82,14 +82,14 @@
<%= link_to inbox_messages_path do %>
<%= number_with_delimiter(current_user.new_messages.size) %>
- <%= t('user.show.my messages') %>
+ <%= t('users.show.my messages') %>
<% end %>
- <%= link_to t('user.show.my profile'), user_path(current_user) %>
+ <%= link_to t('users.show.my profile'), user_path(current_user) %>
- <%= link_to t('user.show.my settings'), :controller => 'user', :action => 'account', :display_name => current_user.display_name %>
+ <%= link_to t('users.show.my settings'), :controller => 'users', :action => 'account', :display_name => current_user.display_name %>
diff --git a/app/views/user/_api_user.builder b/app/views/users/_api_user.builder
similarity index 100%
rename from app/views/user/_api_user.builder
rename to app/views/users/_api_user.builder
diff --git a/app/views/user/_auth_association.html.erb b/app/views/users/_auth_association.html.erb
similarity index 100%
rename from app/views/user/_auth_association.html.erb
rename to app/views/users/_auth_association.html.erb
diff --git a/app/views/user/_contact.html.erb b/app/views/users/_contact.html.erb
similarity index 80%
rename from app/views/user/_contact.html.erb
rename to app/views/users/_contact.html.erb
index 123f511d2..bcc2faf35 100644
--- a/app/views/user/_contact.html.erb
+++ b/app/views/users/_contact.html.erb
@@ -35,12 +35,12 @@
- <%= link_to t('user.show.send message'), new_message_path(contact) %>
+ <%= link_to t('users.show.send message'), new_message_path(contact) %>
<% if current_user.is_friends_with?(contact) %>
- <%= link_to t('user.show.remove as friend'), remove_friend_path(:display_name => contact.display_name, :referer => request.fullpath), :method => :post %>
+ <%= link_to t('users.show.remove as friend'), remove_friend_path(:display_name => contact.display_name, :referer => request.fullpath), :method => :post %>
<% else %>
- <%= link_to t('user.show.add as friend'), make_friend_path(:display_name => contact.display_name, :referer => request.fullpath), :method => :post %>
+ <%= link_to t('users.show.add as friend'), make_friend_path(:display_name => contact.display_name, :referer => request.fullpath), :method => :post %>
<% end %>
diff --git a/app/views/user/_popup.html.erb b/app/views/users/_popup.html.erb
similarity index 100%
rename from app/views/user/_popup.html.erb
rename to app/views/users/_popup.html.erb
diff --git a/app/views/user/_terms.html.erb b/app/views/users/_terms.html.erb
similarity index 100%
rename from app/views/user/_terms.html.erb
rename to app/views/users/_terms.html.erb
diff --git a/app/views/user/_user.html.erb b/app/views/users/_user.html.erb
similarity index 89%
rename from app/views/user/_user.html.erb
rename to app/views/users/_user.html.erb
index da9ae75c9..b9b7bc963 100644
--- a/app/views/user/_user.html.erb
+++ b/app/views/users/_user.html.erb
@@ -7,13 +7,13 @@
<% if user.creation_ip %>
- <%= raw t 'user.index.summary',
+ <%= raw t 'users.index.summary',
:name => link_to(h(user.display_name), user_path(user)),
:ip_address => link_to(user.creation_ip, :ip => user.creation_ip),
:date => l(user.creation_time, :format => :friendly)
%>
<% else %>
- <%= raw t 'user.index.summary_no_ip',
+ <%= raw t 'users.index.summary_no_ip',
:name => link_to(h(user.display_name), user_path(user)),
:date => l(user.creation_time, :format => :friendly)
%>
diff --git a/app/views/user/account.html.erb b/app/views/users/account.html.erb
similarity index 94%
rename from app/views/user/account.html.erb
rename to app/views/users/account.html.erb
index 352adf887..7638b7a77 100644
--- a/app/views/user/account.html.erb
+++ b/app/views/users/account.html.erb
@@ -6,7 +6,7 @@
<%= t '.my settings' %>
<%= link_to t('.return to profile'), user_path(current_user) %>
- <%= link_to t('user.show.oauth settings'), :controller => 'oauth_clients', :action => 'index' %>
+ <%= link_to t('users.show.oauth settings'), :controller => 'oauth_clients', :action => 'index' %>
<% end %>
@@ -14,7 +14,7 @@
<%= form_for current_user, :url => { :action => :account }, :method => :post, :html => { :multipart => true, :id => 'accountForm', :class => 'standard-form', :autocomplete => :off } do |f| %>
- <%= t 'user.new.display name' %>
+ <%= t 'users.new.display name' %>
<%= f.text_field :display_name %>
@@ -35,12 +35,12 @@
- <%= t 'user.new.password' %>
+ <%= t 'users.new.password' %>
<%= f.password_field :pass_crypt, {:value => '', :autocomplete => :off} %>
- <%= t 'user.new.confirm password' %>
+ <%= t 'users.new.confirm password' %>
<%= f.password_field :pass_crypt_confirmation, {:value => '', :autocomplete => :off} %>
@@ -79,7 +79,7 @@
<% end %>
<% else %>
<%= t '.contributor terms.not yet agreed' %>
- <%= link_to t('.contributor terms.review link text'), :controller => 'user', :action => 'terms' %>
+ <%= link_to t('.contributor terms.review link text'), :controller => 'users', :action => 'terms' %>
<% end %>
diff --git a/app/views/user/api_read.builder b/app/views/users/api_read.builder
similarity index 100%
rename from app/views/user/api_read.builder
rename to app/views/users/api_read.builder
diff --git a/app/views/user/api_users.builder b/app/views/users/api_users.builder
similarity index 100%
rename from app/views/user/api_users.builder
rename to app/views/users/api_users.builder
diff --git a/app/views/user/blocked.html.erb b/app/views/users/blocked.html.erb
similarity index 100%
rename from app/views/user/blocked.html.erb
rename to app/views/users/blocked.html.erb
diff --git a/app/views/user/confirm.html.erb b/app/views/users/confirm.html.erb
similarity index 100%
rename from app/views/user/confirm.html.erb
rename to app/views/users/confirm.html.erb
diff --git a/app/views/user/confirm_email.html.erb b/app/views/users/confirm_email.html.erb
similarity index 100%
rename from app/views/user/confirm_email.html.erb
rename to app/views/users/confirm_email.html.erb
diff --git a/app/views/user/index.html.erb b/app/views/users/index.html.erb
similarity index 100%
rename from app/views/user/index.html.erb
rename to app/views/users/index.html.erb
diff --git a/app/views/user/login.html.erb b/app/views/users/login.html.erb
similarity index 94%
rename from app/views/user/login.html.erb
rename to app/views/users/login.html.erb
index 21705e358..0944d7809 100644
--- a/app/views/user/login.html.erb
+++ b/app/views/users/login.html.erb
@@ -28,7 +28,7 @@
<%= password_field_tag "password", "", :tabindex => 2 %>
- <%= link_to t('.lost password link'), :controller => 'user', :action => 'lost_password' %>
+ <%= link_to t('.lost password link'), :controller => 'users', :action => 'lost_password' %>
@@ -69,7 +69,7 @@
diff --git a/app/views/user/logout.html.erb b/app/views/users/logout.html.erb
similarity index 100%
rename from app/views/user/logout.html.erb
rename to app/views/users/logout.html.erb
diff --git a/app/views/user/lost_password.html.erb b/app/views/users/lost_password.html.erb
similarity index 100%
rename from app/views/user/lost_password.html.erb
rename to app/views/users/lost_password.html.erb
diff --git a/app/views/user/make_friend.html.erb b/app/views/users/make_friend.html.erb
similarity index 100%
rename from app/views/user/make_friend.html.erb
rename to app/views/users/make_friend.html.erb
diff --git a/app/views/user/new.html.erb b/app/views/users/new.html.erb
similarity index 100%
rename from app/views/user/new.html.erb
rename to app/views/users/new.html.erb
diff --git a/app/views/user/no_such_user.html.erb b/app/views/users/no_such_user.html.erb
similarity index 100%
rename from app/views/user/no_such_user.html.erb
rename to app/views/users/no_such_user.html.erb
diff --git a/app/views/user/remove_friend.html.erb b/app/views/users/remove_friend.html.erb
similarity index 100%
rename from app/views/user/remove_friend.html.erb
rename to app/views/users/remove_friend.html.erb
diff --git a/app/views/user/reset_password.html.erb b/app/views/users/reset_password.html.erb
similarity index 100%
rename from app/views/user/reset_password.html.erb
rename to app/views/users/reset_password.html.erb
diff --git a/app/views/user/show.html.erb b/app/views/users/show.html.erb
similarity index 97%
rename from app/views/user/show.html.erb
rename to app/views/users/show.html.erb
index 30c72b140..7aa3abd27 100644
--- a/app/views/user/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -25,7 +25,7 @@
<%= link_to t('.my comments' ), :controller => 'diary_entry', :action => 'comments', :display_name => current_user.display_name %>
- <%= link_to t('.my settings'), :controller => 'user', :action => 'account', :display_name => current_user.display_name %>
+ <%= link_to t('.my settings'), :controller => 'users', :action => 'account', :display_name => current_user.display_name %>
<% if current_user.blocks.exists? %>
@@ -179,7 +179,7 @@
<% if current_user and @user.id == current_user.id %>
<% if @user.home_lat.nil? or @user.home_lon.nil? %>
-
<%= raw(t '.if set location', :settings_link => (link_to t('.settings_link_text'), :controller => 'user', :action => 'account', :display_name => current_user.display_name)) %>
+
<%= raw(t '.if set location', :settings_link => (link_to t('.settings_link_text'), :controller => 'users', :action => 'account', :display_name => current_user.display_name)) %>
<% else %>
<% content_for :head do %>
diff --git a/app/views/user/suspended.html.erb b/app/views/users/suspended.html.erb
similarity index 100%
rename from app/views/user/suspended.html.erb
rename to app/views/users/suspended.html.erb
diff --git a/app/views/user/terms.html.erb b/app/views/users/terms.html.erb
similarity index 100%
rename from app/views/user/terms.html.erb
rename to app/views/users/terms.html.erb
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 5c96e8191..6e126e27e 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1889,7 +1889,7 @@ en:
flash: "Updated the client information successfully"
destroy:
flash: "Destroyed the client application registration"
- user:
+ users:
login:
title: "Login"
heading: "Login"
diff --git a/config/routes.rb b/config/routes.rb
index e60994863..2750485b9 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -64,10 +64,10 @@ OpenStreetMap::Application.routes.draw do
get "relations/search" => "search#search_relations"
get "nodes/search" => "search#search_nodes"
- get "user/:id" => "user#api_read", :id => /\d+/
- get "user/details" => "user#api_details"
- get "user/gpx_files" => "user#api_gpx_files"
- get "users" => "user#api_users", :as => :api_users
+ get "user/:id" => "users#api_read", :id => /\d+/
+ get "user/details" => "users#api_details"
+ get "user/gpx_files" => "users#api_gpx_files"
+ get "users" => "users#api_users", :as => :api_users
get "user/preferences" => "user_preferences#read"
get "user/preferences/:preference_key" => "user_preferences#read_one"
@@ -154,33 +154,33 @@ OpenStreetMap::Application.routes.draw do
get "/history/feed" => "changeset#feed", :defaults => { :format => :atom }
get "/history/comments/feed" => "changeset#comments_feed", :as => :changesets_comments_feed, :defaults => { :format => "rss" }
get "/export" => "site#export"
- match "/login" => "user#login", :via => [:get, :post]
- match "/logout" => "user#logout", :via => [:get, :post]
+ match "/login" => "users#login", :via => [:get, :post]
+ match "/logout" => "users#logout", :via => [:get, :post]
get "/offline" => "site#offline"
get "/key" => "site#key"
get "/id" => "site#id"
get "/query" => "browse#query"
- get "/user/new" => "user#new"
- post "/user/new" => "user#create"
- get "/user/terms" => "user#terms"
- post "/user/save" => "user#save"
- get "/user/:display_name/confirm/resend" => "user#confirm_resend"
- match "/user/:display_name/confirm" => "user#confirm", :via => [:get, :post]
- match "/user/confirm" => "user#confirm", :via => [:get, :post]
- match "/user/confirm-email" => "user#confirm_email", :via => [:get, :post]
- post "/user/go_public" => "user#go_public"
- match "/user/reset-password" => "user#reset_password", :via => [:get, :post]
- match "/user/forgot-password" => "user#lost_password", :via => [:get, :post]
- get "/user/suspended" => "user#suspended"
+ get "/user/new" => "users#new"
+ post "/user/new" => "users#create"
+ get "/user/terms" => "users#terms"
+ post "/user/save" => "users#save"
+ get "/user/:display_name/confirm/resend" => "users#confirm_resend"
+ match "/user/:display_name/confirm" => "users#confirm", :via => [:get, :post]
+ match "/user/confirm" => "users#confirm", :via => [:get, :post]
+ match "/user/confirm-email" => "users#confirm_email", :via => [:get, :post]
+ post "/user/go_public" => "users#go_public"
+ match "/user/reset-password" => "users#reset_password", :via => [:get, :post]
+ match "/user/forgot-password" => "users#lost_password", :via => [:get, :post]
+ get "/user/suspended" => "users#suspended"
get "/index.html", :to => redirect(:path => "/")
get "/create-account.html", :to => redirect(:path => "/user/new")
get "/forgot-password.html", :to => redirect(:path => "/user/forgot-password")
# omniauth
- get "/auth/failure" => "user#auth_failure"
- match "/auth/:provider/callback" => "user#auth_success", :via => [:get, :post], :as => :auth_success
- match "/auth/:provider" => "user#auth", :via => [:get, :post], :as => :auth
+ get "/auth/failure" => "users#auth_failure"
+ match "/auth/:provider/callback" => "users#auth_success", :via => [:get, :post], :as => :auth_success
+ match "/auth/:provider" => "users#auth", :via => [:get, :post], :as => :auth
# permalink
get "/go/:code" => "site#permalink", :code => /[a-zA-Z0-9_@~]+[=-]*/
@@ -234,16 +234,16 @@ OpenStreetMap::Application.routes.draw do
post "/user/:display_name/diary/:id/unsubscribe" => "diary_entry#unsubscribe", :as => :diary_entry_unsubscribe, :id => /\d+/
# user pages
- get "/user/:display_name" => "user#show", :as => "user"
- match "/user/:display_name/make_friend" => "user#make_friend", :via => [:get, :post], :as => "make_friend"
- match "/user/:display_name/remove_friend" => "user#remove_friend", :via => [:get, :post], :as => "remove_friend"
- match "/user/:display_name/account" => "user#account", :via => [:get, :post]
- get "/user/:display_name/set_status" => "user#set_status", :as => :set_status_user
- get "/user/:display_name/delete" => "user#delete", :as => :delete_user
+ get "/user/:display_name" => "users#show", :as => "user"
+ match "/user/:display_name/make_friend" => "users#make_friend", :via => [:get, :post], :as => "make_friend"
+ match "/user/:display_name/remove_friend" => "users#remove_friend", :via => [:get, :post], :as => "remove_friend"
+ match "/user/:display_name/account" => "users#account", :via => [:get, :post]
+ get "/user/:display_name/set_status" => "users#set_status", :as => :set_status_user
+ get "/user/:display_name/delete" => "users#delete", :as => :delete_user
# user lists
- match "/users" => "user#index", :via => [:get, :post]
- match "/users/:status" => "user#index", :via => [:get, :post]
+ match "/users" => "users#index", :via => [:get, :post]
+ match "/users/:status" => "users#index", :via => [:get, :post]
# geocoder
get "/search" => "geocoder#search"
diff --git a/test/controllers/changeset_controller_test.rb b/test/controllers/changeset_controller_test.rb
index 2886780a0..2cda68b12 100644
--- a/test/controllers/changeset_controller_test.rb
+++ b/test/controllers/changeset_controller_test.rb
@@ -1969,11 +1969,11 @@ CHANGESET
def test_index_user_not_found
get :index, :params => { :format => "html", :display_name => "Some random user" }
assert_response :not_found
- assert_template "user/no_such_user"
+ assert_template "users/no_such_user"
get :index, :params => { :format => "html", :display_name => "Some random user", :list => "1" }, :xhr => true
assert_response :not_found
- assert_template "user/no_such_user"
+ assert_template "users/no_such_user"
end
##
@@ -1985,7 +1985,7 @@ CHANGESET
get :index, :params => { :friends => true }
assert_response :redirect
- assert_redirected_to :controller => :user, :action => :login, :referer => friend_changesets_path
+ assert_redirected_to :controller => :users, :action => :login, :referer => friend_changesets_path
session[:user] = private_user.id
@@ -2009,7 +2009,7 @@ CHANGESET
get :index, :params => { :nearby => true }
assert_response :redirect
- assert_redirected_to :controller => :user, :action => :login, :referer => nearby_changesets_path
+ assert_redirected_to :controller => :users, :action => :login, :referer => nearby_changesets_path
session[:user] = private_user.id
diff --git a/test/controllers/diary_entry_controller_test.rb b/test/controllers/diary_entry_controller_test.rb
index edff90625..f28bef6fe 100644
--- a/test/controllers/diary_entry_controller_test.rb
+++ b/test/controllers/diary_entry_controller_test.rb
@@ -104,7 +104,7 @@ class DiaryEntryControllerTest < ActionController::TestCase
# 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
@@ -240,7 +240,7 @@ class DiaryEntryControllerTest < ActionController::TestCase
: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
@@ -254,7 +254,7 @@ class DiaryEntryControllerTest < ActionController::TestCase
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,
@@ -474,7 +474,7 @@ class DiaryEntryControllerTest < ActionController::TestCase
: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,
@@ -508,7 +508,7 @@ class DiaryEntryControllerTest < ActionController::TestCase
# 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
@@ -521,7 +521,7 @@ class DiaryEntryControllerTest < ActionController::TestCase
# 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 }
@@ -539,7 +539,7 @@ class DiaryEntryControllerTest < ActionController::TestCase
# 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 }
diff --git a/test/controllers/messages_controller_test.rb b/test/controllers/messages_controller_test.rb
index 940144a17..8926f7311 100644
--- a/test/controllers/messages_controller_test.rb
+++ b/test/controllers/messages_controller_test.rb
@@ -195,7 +195,7 @@ class MessagesControllerTest < ActionController::TestCase
# Asking to send a message with a bogus user name should fail
get :new, :params => { :display_name => "non_existent_user" }
assert_response :not_found
- assert_template "user/no_such_user"
+ assert_template "users/no_such_user"
assert_select "h1", "The user non_existent_user does not exist"
end
diff --git a/test/controllers/site_controller_test.rb b/test/controllers/site_controller_test.rb
index b8941ed30..c4e1a5a66 100644
--- a/test/controllers/site_controller_test.rb
+++ b/test/controllers/site_controller_test.rb
@@ -165,7 +165,7 @@ class SiteControllerTest < ActionController::TestCase
def test_edit
get :edit
assert_response :redirect
- assert_redirected_to :controller => :user, :action => :login, :referer => "/edit"
+ assert_redirected_to :controller => :users, :action => :login, :referer => "/edit"
end
# Test the right editor gets used when the user hasn't set a preference
@@ -315,7 +315,7 @@ class SiteControllerTest < ActionController::TestCase
def test_welcome
get :welcome
assert_response :redirect
- assert_redirected_to :controller => :user, :action => :login, :referer => "/welcome"
+ assert_redirected_to :controller => :users, :action => :login, :referer => "/welcome"
get :welcome, :session => { :user => create(:user) }
assert_response :success
diff --git a/test/controllers/traces_controller_test.rb b/test/controllers/traces_controller_test.rb
index add7483a3..2c01ef6f1 100644
--- a/test/controllers/traces_controller_test.rb
+++ b/test/controllers/traces_controller_test.rb
@@ -210,7 +210,7 @@ class TracesControllerTest < ActionController::TestCase
# First try to get it when not logged in
get :mine
- assert_redirected_to :controller => "user", :action => "login", :referer => "/traces/mine"
+ assert_redirected_to :controller => "users", :action => "login", :referer => "/traces/mine"
# Now try when logged in
get :mine, :session => { :user => user }
@@ -255,7 +255,7 @@ class TracesControllerTest < ActionController::TestCase
# Should get an error if the user does not exist
get :index, :params => { :display_name => "UnknownUser" }
assert_response :not_found
- assert_template "user/no_such_user"
+ assert_template "users/no_such_user"
end
# Check a multi-page index
@@ -547,7 +547,7 @@ class TracesControllerTest < ActionController::TestCase
# First with no auth
get :new
assert_response :redirect
- assert_redirected_to :controller => :user, :action => :login, :referer => new_trace_path
+ assert_redirected_to :controller => :users, :action => :login, :referer => new_trace_path
# Now authenticated as a user with gps.trace.visibility set
user = create(:user)
@@ -628,7 +628,7 @@ class TracesControllerTest < ActionController::TestCase
# First with no auth
get :edit, :params => { :display_name => public_trace_file.user.display_name, :id => public_trace_file.id }
assert_response :redirect
- assert_redirected_to :controller => :user, :action => :login, :referer => edit_trace_path(:display_name => public_trace_file.user.display_name, :id => public_trace_file.id)
+ assert_redirected_to :controller => :users, :action => :login, :referer => edit_trace_path(:display_name => public_trace_file.user.display_name, :id => public_trace_file.id)
# Now with some other user, which should fail
get :edit, :params => { :display_name => public_trace_file.user.display_name, :id => public_trace_file.id }, :session => { :user => create(:user) }
diff --git a/test/controllers/user_blocks_controller_test.rb b/test/controllers/user_blocks_controller_test.rb
index 62eee71a6..77b17519e 100644
--- a/test/controllers/user_blocks_controller_test.rb
+++ b/test/controllers/user_blocks_controller_test.rb
@@ -165,13 +165,13 @@ class UserBlocksControllerTest < ActionController::TestCase
# We should get an error if no user is specified
get :new
assert_response :not_found
- assert_template "user/no_such_user"
+ assert_template "users/no_such_user"
assert_select "h1", "The user does not exist"
# We should get an error if the user doesn't exist
get :new, :params => { :display_name => "non_existent_user" }
assert_response :not_found
- assert_template "user/no_such_user"
+ assert_template "users/no_such_user"
assert_select "h1", "The user non_existent_user does not exist"
end
@@ -268,13 +268,13 @@ class UserBlocksControllerTest < ActionController::TestCase
# We should get an error if no user is specified
post :create
assert_response :not_found
- assert_template "user/no_such_user"
+ assert_template "users/no_such_user"
assert_select "h1", "The user does not exist"
# We should get an error if the user doesn't exist
post :create, :params => { :display_name => "non_existent_user" }
assert_response :not_found
- assert_template "user/no_such_user"
+ assert_template "users/no_such_user"
assert_select "h1", "The user non_existent_user does not exist"
end
@@ -412,7 +412,7 @@ class UserBlocksControllerTest < ActionController::TestCase
# Asking for a list of blocks with a bogus user name should fail
get :blocks_on, :params => { :display_name => "non_existent_user" }
assert_response :not_found
- assert_template "user/no_such_user"
+ assert_template "users/no_such_user"
assert_select "h1", "The user non_existent_user does not exist"
# Check the list of blocks for a user that has never been blocked
@@ -476,7 +476,7 @@ class UserBlocksControllerTest < ActionController::TestCase
# Asking for a list of blocks with a bogus user name should fail
get :blocks_by, :params => { :display_name => "non_existent_user" }
assert_response :not_found
- assert_template "user/no_such_user"
+ assert_template "users/no_such_user"
assert_select "h1", "The user non_existent_user does not exist"
# Check the list of blocks given by one moderator
diff --git a/test/controllers/user_roles_controller_test.rb b/test/controllers/user_roles_controller_test.rb
index 705f06a1c..e9aadcc3a 100644
--- a/test/controllers/user_roles_controller_test.rb
+++ b/test/controllers/user_roles_controller_test.rb
@@ -43,7 +43,7 @@ class UserRolesControllerTest < ActionController::TestCase
post :grant, :params => { :display_name => "non_existent_user", :role => role }
end
assert_response :not_found
- assert_template "user/no_such_user"
+ assert_template "users/no_such_user"
assert_select "h1", "The user non_existent_user does not exist"
# Granting a role to a user that already has it should fail
@@ -104,7 +104,7 @@ class UserRolesControllerTest < ActionController::TestCase
post :revoke, :params => { :display_name => "non_existent_user", :role => role }
end
assert_response :not_found
- assert_template "user/no_such_user"
+ assert_template "users/no_such_user"
assert_select "h1", "The user non_existent_user does not exist"
# Removing a role from a user that doesn't have it should fail
diff --git a/test/controllers/user_controller_test.rb b/test/controllers/users_controller_test.rb
similarity index 95%
rename from test/controllers/user_controller_test.rb
rename to test/controllers/users_controller_test.rb
index ffae32d0c..ce64310cb 100644
--- a/test/controllers/user_controller_test.rb
+++ b/test/controllers/users_controller_test.rb
@@ -1,6 +1,6 @@
require "test_helper"
-class UserControllerTest < ActionController::TestCase
+class UsersControllerTest < ActionController::TestCase
def setup
stub_hostip_requests
end
@@ -10,179 +10,179 @@ class UserControllerTest < ActionController::TestCase
def test_routes
assert_routing(
{ :path => "/api/0.6/user/1", :method => :get },
- { :controller => "user", :action => "api_read", :id => "1" }
+ { :controller => "users", :action => "api_read", :id => "1" }
)
assert_routing(
{ :path => "/api/0.6/user/details", :method => :get },
- { :controller => "user", :action => "api_details" }
+ { :controller => "users", :action => "api_details" }
)
assert_routing(
{ :path => "/api/0.6/user/gpx_files", :method => :get },
- { :controller => "user", :action => "api_gpx_files" }
+ { :controller => "users", :action => "api_gpx_files" }
)
assert_routing(
{ :path => "/api/0.6/users", :method => :get },
- { :controller => "user", :action => "api_users" }
+ { :controller => "users", :action => "api_users" }
)
assert_routing(
{ :path => "/login", :method => :get },
- { :controller => "user", :action => "login" }
+ { :controller => "users", :action => "login" }
)
assert_routing(
{ :path => "/login", :method => :post },
- { :controller => "user", :action => "login" }
+ { :controller => "users", :action => "login" }
)
assert_recognizes(
- { :controller => "user", :action => "login", :format => "html" },
+ { :controller => "users", :action => "login", :format => "html" },
{ :path => "/login.html", :method => :get }
)
assert_routing(
{ :path => "/logout", :method => :get },
- { :controller => "user", :action => "logout" }
+ { :controller => "users", :action => "logout" }
)
assert_routing(
{ :path => "/logout", :method => :post },
- { :controller => "user", :action => "logout" }
+ { :controller => "users", :action => "logout" }
)
assert_recognizes(
- { :controller => "user", :action => "logout", :format => "html" },
+ { :controller => "users", :action => "logout", :format => "html" },
{ :path => "/logout.html", :method => :get }
)
assert_routing(
{ :path => "/user/new", :method => :get },
- { :controller => "user", :action => "new" }
+ { :controller => "users", :action => "new" }
)
assert_routing(
{ :path => "/user/new", :method => :post },
- { :controller => "user", :action => "create" }
+ { :controller => "users", :action => "create" }
)
assert_routing(
{ :path => "/user/terms", :method => :get },
- { :controller => "user", :action => "terms" }
+ { :controller => "users", :action => "terms" }
)
assert_routing(
{ :path => "/user/save", :method => :post },
- { :controller => "user", :action => "save" }
+ { :controller => "users", :action => "save" }
)
assert_routing(
{ :path => "/user/username/confirm", :method => :get },
- { :controller => "user", :action => "confirm", :display_name => "username" }
+ { :controller => "users", :action => "confirm", :display_name => "username" }
)
assert_routing(
{ :path => "/user/username/confirm", :method => :post },
- { :controller => "user", :action => "confirm", :display_name => "username" }
+ { :controller => "users", :action => "confirm", :display_name => "username" }
)
assert_routing(
{ :path => "/user/username/confirm/resend", :method => :get },
- { :controller => "user", :action => "confirm_resend", :display_name => "username" }
+ { :controller => "users", :action => "confirm_resend", :display_name => "username" }
)
assert_routing(
{ :path => "/user/confirm", :method => :get },
- { :controller => "user", :action => "confirm" }
+ { :controller => "users", :action => "confirm" }
)
assert_routing(
{ :path => "/user/confirm", :method => :post },
- { :controller => "user", :action => "confirm" }
+ { :controller => "users", :action => "confirm" }
)
assert_routing(
{ :path => "/user/confirm-email", :method => :get },
- { :controller => "user", :action => "confirm_email" }
+ { :controller => "users", :action => "confirm_email" }
)
assert_routing(
{ :path => "/user/confirm-email", :method => :post },
- { :controller => "user", :action => "confirm_email" }
+ { :controller => "users", :action => "confirm_email" }
)
assert_routing(
{ :path => "/user/go_public", :method => :post },
- { :controller => "user", :action => "go_public" }
+ { :controller => "users", :action => "go_public" }
)
assert_routing(
{ :path => "/user/forgot-password", :method => :get },
- { :controller => "user", :action => "lost_password" }
+ { :controller => "users", :action => "lost_password" }
)
assert_routing(
{ :path => "/user/forgot-password", :method => :post },
- { :controller => "user", :action => "lost_password" }
+ { :controller => "users", :action => "lost_password" }
)
assert_routing(
{ :path => "/user/reset-password", :method => :get },
- { :controller => "user", :action => "reset_password" }
+ { :controller => "users", :action => "reset_password" }
)
assert_routing(
{ :path => "/user/reset-password", :method => :post },
- { :controller => "user", :action => "reset_password" }
+ { :controller => "users", :action => "reset_password" }
)
assert_routing(
{ :path => "/user/suspended", :method => :get },
- { :controller => "user", :action => "suspended" }
+ { :controller => "users", :action => "suspended" }
)
assert_routing(
{ :path => "/user/username", :method => :get },
- { :controller => "user", :action => "show", :display_name => "username" }
+ { :controller => "users", :action => "show", :display_name => "username" }
)
assert_routing(
{ :path => "/user/username/account", :method => :get },
- { :controller => "user", :action => "account", :display_name => "username" }
+ { :controller => "users", :action => "account", :display_name => "username" }
)
assert_routing(
{ :path => "/user/username/account", :method => :post },
- { :controller => "user", :action => "account", :display_name => "username" }
+ { :controller => "users", :action => "account", :display_name => "username" }
)
assert_routing(
{ :path => "/user/username/make_friend", :method => :get },
- { :controller => "user", :action => "make_friend", :display_name => "username" }
+ { :controller => "users", :action => "make_friend", :display_name => "username" }
)
assert_routing(
{ :path => "/user/username/make_friend", :method => :post },
- { :controller => "user", :action => "make_friend", :display_name => "username" }
+ { :controller => "users", :action => "make_friend", :display_name => "username" }
)
assert_routing(
{ :path => "/user/username/remove_friend", :method => :get },
- { :controller => "user", :action => "remove_friend", :display_name => "username" }
+ { :controller => "users", :action => "remove_friend", :display_name => "username" }
)
assert_routing(
{ :path => "/user/username/remove_friend", :method => :post },
- { :controller => "user", :action => "remove_friend", :display_name => "username" }
+ { :controller => "users", :action => "remove_friend", :display_name => "username" }
)
assert_routing(
{ :path => "/user/username/set_status", :method => :get },
- { :controller => "user", :action => "set_status", :display_name => "username" }
+ { :controller => "users", :action => "set_status", :display_name => "username" }
)
assert_routing(
{ :path => "/user/username/delete", :method => :get },
- { :controller => "user", :action => "delete", :display_name => "username" }
+ { :controller => "users", :action => "delete", :display_name => "username" }
)
assert_routing(
{ :path => "/users", :method => :get },
- { :controller => "user", :action => "index" }
+ { :controller => "users", :action => "index" }
)
assert_routing(
{ :path => "/users", :method => :post },
- { :controller => "user", :action => "index" }
+ { :controller => "users", :action => "index" }
)
assert_routing(
{ :path => "/users/status", :method => :get },
- { :controller => "user", :action => "index", :status => "status" }
+ { :controller => "users", :action => "index", :status => "status" }
)
assert_routing(
{ :path => "/users/status", :method => :post },
- { :controller => "user", :action => "index", :status => "status" }
+ { :controller => "users", :action => "index", :status => "status" }
)
end
@@ -782,7 +782,7 @@ class UserControllerTest < ActionController::TestCase
# you are not logged in
get :account, :params => { :display_name => user.display_name }
assert_response :redirect
- assert_redirected_to :controller => :user, :action => "login", :referer => "/user/#{ERB::Util.u(user.display_name)}/account"
+ assert_redirected_to :action => "login", :referer => "/user/#{ERB::Util.u(user.display_name)}/account"
# Make sure that you are blocked when not logged in as the right user
get :account, :params => { :display_name => user.display_name }, :session => { :user => create(:user) }
@@ -1238,7 +1238,7 @@ class UserControllerTest < ActionController::TestCase
# When not logged in a GET should ask us to login
get :make_friend, :params => { :display_name => friend.display_name }
- assert_redirected_to :controller => :user, :action => "login", :referer => make_friend_path(:display_name => friend.display_name)
+ assert_redirected_to :action => "login", :referer => make_friend_path(:display_name => friend.display_name)
# When not logged in a POST should error
post :make_friend, :params => { :display_name => friend.display_name }
@@ -1325,7 +1325,7 @@ class UserControllerTest < ActionController::TestCase
# When not logged in a GET should ask us to login
get :remove_friend, :params => { :display_name => friend.display_name }
- assert_redirected_to :controller => :user, :action => "login", :referer => remove_friend_path(:display_name => friend.display_name)
+ assert_redirected_to :action => "login", :referer => remove_friend_path(:display_name => friend.display_name)
# When not logged in a POST should error
post :remove_friend, :params => { :display_name => friend.display_name }
diff --git a/test/integration/client_applications_test.rb b/test/integration/client_applications_test.rb
index c786b4f4a..b50a990c6 100644
--- a/test/integration/client_applications_test.rb
+++ b/test/integration/client_applications_test.rb
@@ -9,17 +9,17 @@ class ClientApplicationsTest < ActionDispatch::IntegrationTest
get "/login"
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true"
follow_redirect!
assert_response :success
post "/login", :params => { "username" => user.email, "password" => "test", :referer => "/user/#{ERB::Util.u(user.display_name)}" }
assert_response :redirect
follow_redirect!
assert_response :success
- assert_template "user/show"
+ assert_template "users/show"
get "/user/#{ERB::Util.u(user.display_name)}/account"
assert_response :success
- assert_template "user/account"
+ assert_template "users/account"
# check that the form to allow new client application creations exists
assert_in_heading do
diff --git a/test/integration/user_changeset_comments_test.rb b/test/integration/user_changeset_comments_test.rb
index 5f655c481..2953f5fe2 100644
--- a/test/integration/user_changeset_comments_test.rb
+++ b/test/integration/user_changeset_comments_test.rb
@@ -30,7 +30,7 @@ class UserChangesetCommentsTest < ActionDispatch::IntegrationTest
follow_redirect!
# We should now be at the login page
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
# We can now login
post "/login", :params => { "username" => user.email, "password" => "test" }
assert_response :redirect
diff --git a/test/integration/user_creation_test.rb b/test/integration/user_creation_test.rb
index fbec2fb93..555e579f4 100644
--- a/test/integration/user_creation_test.rb
+++ b/test/integration/user_creation_test.rb
@@ -27,7 +27,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
get "/user/new", :headers => { "HTTP_ACCEPT_LANGUAGE" => locale.to_s }
follow_redirect!
assert_response :success
- assert_template "user/new"
+ assert_template "users/new"
end
end
@@ -43,7 +43,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
end
end
assert_response :success
- assert_template "user/new"
+ assert_template "users/new"
assert_equal locale.to_s, response.headers["Content-Language"] unless locale == :root
assert_select "form > fieldset > div.form-row > input.field_with_errors#user_email"
assert_no_missing_translations
@@ -62,7 +62,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
end
end
assert_response :success
- assert_template "user/new"
+ assert_template "users/new"
assert_select "form > fieldset > div.form-row > input.field_with_errors#user_display_name"
assert_no_missing_translations
end
@@ -99,7 +99,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
# Check the page
assert_response :success
- assert_template "user/confirm"
+ assert_template "users/confirm"
ActionMailer::Base.deliveries.clear
end
@@ -144,14 +144,14 @@ class UserCreationTest < ActionDispatch::IntegrationTest
# Check the page
assert_response :success
- assert_template "user/confirm"
+ assert_template "users/confirm"
ActionMailer::Base.deliveries.clear
# Go to the confirmation page
get "/user/#{display_name}/confirm", :params => { :confirm_string => confirm_string }
assert_response :success
- assert_template "user/confirm"
+ assert_template "users/confirm"
post "/user/#{display_name}/confirm", :params => { :confirm_string => confirm_string }
assert_response :redirect
@@ -187,7 +187,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
# Check the page
assert_response :success
- assert_template "user/confirm"
+ assert_template "users/confirm"
ActionMailer::Base.deliveries.clear
end
@@ -213,7 +213,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
assert_response :redirect
follow_redirect!
assert_response :success
- assert_template "user/new"
+ assert_template "users/new"
end
end
@@ -258,14 +258,14 @@ class UserCreationTest < ActionDispatch::IntegrationTest
# Check the page
assert_response :success
- assert_template "user/confirm"
+ assert_template "users/confirm"
ActionMailer::Base.deliveries.clear
# Go to the confirmation page
get "/user/#{display_name}/confirm", :params => { :confirm_string => confirm_string }
assert_response :success
- assert_template "user/confirm"
+ assert_template "users/confirm"
post "/user/#{display_name}/confirm", :params => { :confirm_string => confirm_string }
assert_response :redirect
@@ -303,7 +303,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
# Check the page
assert_response :success
- assert_template "user/confirm"
+ assert_template "users/confirm"
ActionMailer::Base.deliveries.clear
end
@@ -329,7 +329,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
assert_response :redirect
follow_redirect!
assert_response :success
- assert_template "user/new"
+ assert_template "users/new"
end
end
@@ -376,14 +376,14 @@ class UserCreationTest < ActionDispatch::IntegrationTest
# Check the page
assert_response :success
- assert_template "user/confirm"
+ assert_template "users/confirm"
ActionMailer::Base.deliveries.clear
# Go to the confirmation page
get "/user/#{display_name}/confirm", :params => { :confirm_string => confirm_string }
assert_response :success
- assert_template "user/confirm"
+ assert_template "users/confirm"
post "/user/#{display_name}/confirm", :params => { :confirm_string => confirm_string }
assert_response :redirect
@@ -419,7 +419,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
# Check the page
assert_response :success
- assert_template "user/confirm"
+ assert_template "users/confirm"
ActionMailer::Base.deliveries.clear
end
@@ -445,7 +445,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
assert_response :redirect
follow_redirect!
assert_response :success
- assert_template "user/new"
+ assert_template "users/new"
end
end
@@ -490,14 +490,14 @@ class UserCreationTest < ActionDispatch::IntegrationTest
# Check the page
assert_response :success
- assert_template "user/confirm"
+ assert_template "users/confirm"
ActionMailer::Base.deliveries.clear
# Go to the confirmation page
get "/user/#{display_name}/confirm", :params => { :confirm_string => confirm_string }
assert_response :success
- assert_template "user/confirm"
+ assert_template "users/confirm"
post "/user/#{display_name}/confirm", :params => { :confirm_string => confirm_string }
assert_response :redirect
@@ -533,7 +533,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
# Check the page
assert_response :success
- assert_template "user/confirm"
+ assert_template "users/confirm"
ActionMailer::Base.deliveries.clear
end
@@ -559,7 +559,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
assert_response :redirect
follow_redirect!
assert_response :success
- assert_template "user/new"
+ assert_template "users/new"
end
end
@@ -604,14 +604,14 @@ class UserCreationTest < ActionDispatch::IntegrationTest
# Check the page
assert_response :success
- assert_template "user/confirm"
+ assert_template "users/confirm"
ActionMailer::Base.deliveries.clear
# Go to the confirmation page
get "/user/#{display_name}/confirm", :params => { :confirm_string => confirm_string }
assert_response :success
- assert_template "user/confirm"
+ assert_template "users/confirm"
post "/user/#{display_name}/confirm", :params => { :confirm_string => confirm_string }
assert_response :redirect
@@ -647,7 +647,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
# Check the page
assert_response :success
- assert_template "user/confirm"
+ assert_template "users/confirm"
ActionMailer::Base.deliveries.clear
end
@@ -673,7 +673,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
assert_response :redirect
follow_redirect!
assert_response :success
- assert_template "user/new"
+ assert_template "users/new"
end
end
@@ -718,14 +718,14 @@ class UserCreationTest < ActionDispatch::IntegrationTest
# Check the page
assert_response :success
- assert_template "user/confirm"
+ assert_template "users/confirm"
ActionMailer::Base.deliveries.clear
# Go to the confirmation page
get "/user/#{display_name}/confirm", :params => { :confirm_string => confirm_string }
assert_response :success
- assert_template "user/confirm"
+ assert_template "users/confirm"
post "/user/#{display_name}/confirm", :params => { :confirm_string => confirm_string }
assert_response :redirect
@@ -761,7 +761,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
# Check the page
assert_response :success
- assert_template "user/confirm"
+ assert_template "users/confirm"
ActionMailer::Base.deliveries.clear
end
@@ -787,7 +787,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
assert_response :redirect
follow_redirect!
assert_response :success
- assert_template "user/new"
+ assert_template "users/new"
end
end
@@ -832,14 +832,14 @@ class UserCreationTest < ActionDispatch::IntegrationTest
# Check the page
assert_response :success
- assert_template "user/confirm"
+ assert_template "users/confirm"
ActionMailer::Base.deliveries.clear
# Go to the confirmation page
get "/user/#{display_name}/confirm", :params => { :confirm_string => confirm_string }
assert_response :success
- assert_template "user/confirm"
+ assert_template "users/confirm"
post "/user/#{display_name}/confirm", :params => { :confirm_string => confirm_string }
assert_response :redirect
diff --git a/test/integration/user_diaries_test.rb b/test/integration/user_diaries_test.rb
index 2c1e65145..57b4a8b0c 100644
--- a/test/integration/user_diaries_test.rb
+++ b/test/integration/user_diaries_test.rb
@@ -11,7 +11,7 @@ class UserDiariesTest < ActionDispatch::IntegrationTest
follow_redirect!
# We should now be at the login page
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
# We can now login
post "/login", :params => { "username" => user.email, "password" => "test", :referer => "/diary/new" }
assert_response :redirect
diff --git a/test/integration/user_login_test.rb b/test/integration/user_login_test.rb
index 2c3e61be6..feaa92065 100644
--- a/test/integration/user_login_test.rb
+++ b/test/integration/user_login_test.rb
@@ -355,10 +355,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to :controller => :user, :action => :login, :cookie_test => true, :referer => "/history"
+ assert_redirected_to :controller => :users, :action => :login, :cookie_test => true, :referer => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
post "/login", :params => { :openid_url => "http://localhost:1123/john.doe", :referer => "/history" }
assert_response :redirect
assert_redirected_to auth_path(:provider => "openid", :openid_url => "http://localhost:1123/john.doe", :origin => "/login?referer=%2Fhistory", :referer => "/history")
@@ -379,10 +379,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to :controller => :user, :action => :login, :cookie_test => true, :referer => "/history"
+ assert_redirected_to :controller => :users, :action => :login, :cookie_test => true, :referer => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
post "/login", :params => { :openid_url => user.auth_uid, :remember_me_openid => true, :referer => "/history" }
assert_response :redirect
assert_redirected_to auth_path(:provider => "openid", :openid_url => user.auth_uid, :origin => "/login?referer=%2Fhistory", :referer => "/history")
@@ -404,10 +404,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to :controller => :user, :action => :login, :cookie_test => true, :referer => "/history"
+ assert_redirected_to :controller => :users, :action => :login, :cookie_test => true, :referer => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
post "/login", :params => { :openid_url => user.auth_uid, :referer => "/history" }
assert_response :redirect
assert_redirected_to auth_path(:provider => "openid", :openid_url => user.auth_uid, :origin => "/login?referer=%2Fhistory", :referer => "/history")
@@ -432,10 +432,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to :controller => :user, :action => :login, :cookie_test => true, :referer => "/history"
+ assert_redirected_to :controller => :users, :action => :login, :cookie_test => true, :referer => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
post "/login", :params => { :openid_url => user.auth_uid, :referer => "/history" }
assert_response :redirect
assert_redirected_to auth_path(:provider => "openid", :openid_url => user.auth_uid, :origin => "/login?referer=%2Fhistory", :referer => "/history")
@@ -459,10 +459,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to :controller => :user, :action => :login, :cookie_test => true, :referer => "/history"
+ assert_redirected_to :controller => :users, :action => :login, :cookie_test => true, :referer => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
post "/login", :params => { :openid_url => "http://localhost:1123/fred.bloggs", :referer => "/history" }
assert_response :redirect
assert_redirected_to auth_path(:provider => "openid", :openid_url => "http://localhost:1123/fred.bloggs", :origin => "/login?referer=%2Fhistory", :referer => "/history")
@@ -473,7 +473,7 @@ class UserLoginTest < ActionDispatch::IntegrationTest
assert_response :redirect
follow_redirect!
assert_response :success
- assert_template "user/new"
+ assert_template "users/new"
assert_select "span.username", false
end
@@ -485,10 +485,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
get auth_path(:provider => "google", :origin => "/login?referer=%2Fhistory", :referer => "/history")
assert_response :redirect
assert_redirected_to auth_success_path(:provider => "google")
@@ -505,10 +505,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
get auth_path(:provider => "google", :origin => "/login?referer=%2Fhistory", :referer => "/history")
assert_response :redirect
assert_redirected_to auth_success_path(:provider => "google")
@@ -529,10 +529,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
get auth_path(:provider => "google", :origin => "/login?referer=%2Fhistory", :referer => "/history")
assert_response :redirect
assert_redirected_to auth_success_path(:provider => "google")
@@ -555,10 +555,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
get auth_path(:provider => "google", :origin => "/login?referer=%2Fhistory", :referer => "/history")
assert_response :redirect
assert_redirected_to auth_success_path(:provider => "google")
@@ -566,7 +566,7 @@ class UserLoginTest < ActionDispatch::IntegrationTest
assert_response :redirect
follow_redirect!
assert_response :success
- assert_template "user/new"
+ assert_template "users/new"
assert_select "span.username", false
end
@@ -578,10 +578,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
get auth_path(:provider => "google", :origin => "/login?referer=%2Fhistory", :referer => "/history")
assert_response :redirect
assert_redirected_to auth_success_path(:provider => "google")
@@ -603,10 +603,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
get auth_path(:provider => "facebook", :origin => "/login?referer=%2Fhistory", :referer => "/history")
assert_response :redirect
assert_redirected_to auth_success_path(:provider => "facebook")
@@ -623,10 +623,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
get auth_path(:provider => "facebook", :origin => "/login?referer=%2Fhistory", :referer => "/history")
assert_response :redirect
assert_redirected_to auth_success_path(:provider => "facebook")
@@ -647,10 +647,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
get auth_path(:provider => "facebook", :origin => "/login?referer=%2Fhistory", :referer => "/history")
assert_response :redirect
assert_redirected_to auth_success_path(:provider => "facebook")
@@ -671,10 +671,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
get auth_path(:provider => "facebook", :origin => "/login?referer=%2Fhistory", :referer => "/history")
assert_response :redirect
assert_redirected_to auth_success_path(:provider => "facebook")
@@ -682,7 +682,7 @@ class UserLoginTest < ActionDispatch::IntegrationTest
assert_response :redirect
follow_redirect!
assert_response :success
- assert_template "user/new"
+ assert_template "users/new"
assert_select "span.username", false
end
@@ -692,10 +692,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
get auth_path(:provider => "windowslive", :origin => "/login?referer=%2Fhistory", :referer => "/history")
assert_response :redirect
assert_redirected_to auth_success_path(:provider => "windowslive")
@@ -712,10 +712,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
get auth_path(:provider => "windowslive", :origin => "/login?referer=%2Fhistory", :referer => "/history")
assert_response :redirect
assert_redirected_to auth_success_path(:provider => "windowslive")
@@ -736,10 +736,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
get auth_path(:provider => "windowslive", :origin => "/login?referer=%2Fhistory", :referer => "/history")
assert_response :redirect
assert_redirected_to auth_success_path(:provider => "windowslive")
@@ -760,10 +760,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
get auth_path(:provider => "windowslive", :origin => "/login?referer=%2Fhistory", :referer => "/history")
assert_response :redirect
assert_redirected_to auth_success_path(:provider => "windowslive")
@@ -771,7 +771,7 @@ class UserLoginTest < ActionDispatch::IntegrationTest
assert_response :redirect
follow_redirect!
assert_response :success
- assert_template "user/new"
+ assert_template "users/new"
assert_select "span.username", false
end
@@ -781,10 +781,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
get auth_path(:provider => "github", :origin => "/login?referer=%2Fhistory", :referer => "/history")
assert_response :redirect
assert_redirected_to auth_success_path(:provider => "github")
@@ -801,10 +801,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
get auth_path(:provider => "github", :origin => "/login?referer=%2Fhistory", :referer => "/history")
assert_response :redirect
assert_redirected_to auth_success_path(:provider => "github")
@@ -825,10 +825,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
get auth_path(:provider => "github", :origin => "/login?referer=%2Fhistory", :referer => "/history")
assert_response :redirect
assert_redirected_to auth_success_path(:provider => "github")
@@ -849,10 +849,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
get auth_path(:provider => "github", :origin => "/login?referer=%2Fhistory", :referer => "/history")
assert_response :redirect
assert_redirected_to auth_success_path(:provider => "github")
@@ -860,7 +860,7 @@ class UserLoginTest < ActionDispatch::IntegrationTest
assert_response :redirect
follow_redirect!
assert_response :success
- assert_template "user/new"
+ assert_template "users/new"
assert_select "span.username", false
end
@@ -870,10 +870,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
get auth_path(:provider => "wikipedia", :origin => "/login?referer=%2Fhistory", :referer => "/history")
assert_response :redirect
assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/login?referer=%2Fhistory", :referer => "/history")
@@ -890,10 +890,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
get auth_path(:provider => "wikipedia", :origin => "/login?referer=%2Fhistory", :referer => "/history")
assert_response :redirect
assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/login?referer=%2Fhistory", :referer => "/history")
@@ -914,10 +914,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
get auth_path(:provider => "wikipedia", :origin => "/login?referer=%2Fhistory", :referer => "/history")
assert_response :redirect
assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/login?referer=%2Fhistory", :referer => "/history")
@@ -938,10 +938,10 @@ class UserLoginTest < ActionDispatch::IntegrationTest
get "/login", :params => { :referer => "/history" }
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
get auth_path(:provider => "wikipedia", :origin => "/login?referer=%2Fhistory", :referer => "/history")
assert_response :redirect
assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/login?referer=%2Fhistory", :referer => "/history")
@@ -949,7 +949,7 @@ class UserLoginTest < ActionDispatch::IntegrationTest
assert_response :redirect
follow_redirect!
assert_response :success
- assert_template "user/new"
+ assert_template "users/new"
assert_select "span.username", false
end
@@ -958,7 +958,7 @@ class UserLoginTest < ActionDispatch::IntegrationTest
def try_password_login(username, password, remember_me = nil)
get "/login"
assert_response :redirect
- assert_redirected_to :controller => :user, :action => :login, :cookie_test => true
+ assert_redirected_to :controller => :users, :action => :login, :cookie_test => true
follow_redirect!
assert_response :success
assert_template "login"
diff --git a/test/integration/user_roles_test.rb b/test/integration/user_roles_test.rb
index 7001abd3d..9d367150d 100644
--- a/test/integration/user_roles_test.rb
+++ b/test/integration/user_roles_test.rb
@@ -23,7 +23,7 @@ class UserRolesTest < ActionDispatch::IntegrationTest
def check_fail(action, user, role)
get "/login"
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true"
follow_redirect!
assert_response :success
post "/login", :params => { "username" => create(user).email, "password" => "test", :referer => "/" }
@@ -41,7 +41,7 @@ class UserRolesTest < ActionDispatch::IntegrationTest
def check_success(action, user, role)
get "/login"
assert_response :redirect
- assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true"
+ assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true"
follow_redirect!
assert_response :success
post "/login", :params => { "username" => create(user).email, "password" => "test", :referer => "/" }
diff --git a/test/integration/user_terms_seen_test.rb b/test/integration/user_terms_seen_test.rb
index 811883f5f..03e8c6f54 100644
--- a/test/integration/user_terms_seen_test.rb
+++ b/test/integration/user_terms_seen_test.rb
@@ -29,11 +29,11 @@ class UserTermsSeenTest < ActionDispatch::IntegrationTest
get "/login"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
post "/login", :params => { :username => user.email, :password => "test", :referer => "/diary/new" }
assert_response :redirect
# but now we need to look at the terms
- assert_redirected_to :controller => :user, :action => :terms, :referer => "/diary/new"
+ assert_redirected_to :controller => :users, :action => :terms, :referer => "/diary/new"
follow_redirect!
assert_response :success
@@ -56,18 +56,18 @@ class UserTermsSeenTest < ActionDispatch::IntegrationTest
get "/login"
follow_redirect!
assert_response :success
- assert_template "user/login"
+ assert_template "users/login"
post "/login", :params => { :username => user.email, :password => "test", :referer => "/diary/new" }
assert_response :redirect
# but now we need to look at the terms
- assert_redirected_to :controller => :user, :action => :terms, :referer => "/diary/new"
+ assert_redirected_to :controller => :users, :action => :terms, :referer => "/diary/new"
# check that if we go somewhere else now, it redirects
# back to the terms page.
get "/traces/mine"
- assert_redirected_to :controller => :user, :action => :terms, :referer => "/traces/mine"
+ assert_redirected_to :controller => :users, :action => :terms, :referer => "/traces/mine"
get "/traces/mine", :params => { :referer => "/diary/new" }
- assert_redirected_to :controller => :user, :action => :terms, :referer => "/diary/new"
+ assert_redirected_to :controller => :users, :action => :terms, :referer => "/diary/new"
end
end
diff --git a/test/system/issues_test.rb b/test/system/issues_test.rb
index 9aee867a9..138de2721 100644
--- a/test/system/issues_test.rb
+++ b/test/system/issues_test.rb
@@ -5,7 +5,7 @@ class IssuesTest < ApplicationSystemTestCase
def test_view_issues_not_logged_in
visit issues_path
- assert page.has_content?(I18n.t("user.login.title"))
+ assert page.has_content?(I18n.t("users.login.title"))
end
def test_view_issues_normal_user
diff --git a/test/system/report_user_test.rb b/test/system/report_user_test.rb
index 9d919523b..7b49f2997 100644
--- a/test/system/report_user_test.rb
+++ b/test/system/report_user_test.rb
@@ -6,7 +6,7 @@ class ReportUserTest < ApplicationSystemTestCase
visit browse_note_path(note)
assert page.has_content?(note.comments.first.body)
- assert_not page.has_content?(I18n.t("user.show.report"))
+ assert_not page.has_content?(I18n.t("users.show.report"))
end
def test_can_report_user
@@ -14,7 +14,7 @@ class ReportUserTest < ApplicationSystemTestCase
sign_in_as(create(:user))
visit user_path(user)
- click_on I18n.t("user.show.report")
+ click_on I18n.t("users.show.report")
assert page.has_content? "Report"
assert page.has_content? I18n.t("reports.new.disclaimer.intro")
@@ -35,7 +35,7 @@ class ReportUserTest < ApplicationSystemTestCase
sign_in_as(create(:user))
visit user_path(user)
- click_on I18n.t("user.show.report")
+ click_on I18n.t("users.show.report")
assert page.has_content? "Report"
assert page.has_content? I18n.t("reports.new.disclaimer.intro")
@@ -52,7 +52,7 @@ class ReportUserTest < ApplicationSystemTestCase
visit user_path(user)
- click_on I18n.t("user.show.report")
+ click_on I18n.t("users.show.report")
assert page.has_content? "Report"
assert page.has_content? I18n.t("reports.new.disclaimer.intro")
--
2.39.5