render_404
end
- def add
+ def new
@notification_options = User::MAIL_NOTIFICATION_OPTIONS
@notification_option = Setting.default_notification_option
Mailer.deliver_account_information(@user, params[:password]) if params[:send_information]
flash[:notice] = l(:notice_successful_create)
- redirect_to(params[:continue] ? {:controller => 'users', :action => 'add'} :
+ redirect_to(params[:continue] ? {:controller => 'users', :action => 'new'} :
{:controller => 'users', :action => 'edit', :id => @user})
return
else
@auth_sources = AuthSource.find(:all)
@notification_option = @user.mail_notification
- render :action => 'add'
+ render :action => 'new'
end
end
+++ /dev/null
-<h2><%= link_to l(:label_user_plural), :controller => 'users', :action => 'index' %> » <%=l(:label_user_new)%></h2>
-
-<% labelled_tabular_form_for :user, @user, :url => { :action => "create" }, :html => { :class => nil } do |f| %>
- <%= render :partial => 'form', :locals => { :f => f } %>
- <p><label><%= check_box_tag 'send_information', 1, true %> <%= l(:label_send_information) %></label></p>
- <p>
- <%= submit_tag l(:button_create) %>
- <%= submit_tag l(:button_create_and_continue), :name => 'continue' %>
- </p>
-<% end %>
<div class="contextual">
-<%= link_to l(:label_user_new), {:action => 'add'}, :class => 'icon icon-add' %>
+<%= link_to l(:label_user_new), {:action => 'new'}, :class => 'icon icon-add' %>
</div>
<h2><%=l(:label_user_plural)%></h2>
--- /dev/null
+<h2><%= link_to l(:label_user_plural), :controller => 'users', :action => 'index' %> » <%=l(:label_user_new)%></h2>
+
+<% labelled_tabular_form_for :user, @user, :url => { :action => "create" }, :html => { :class => nil } do |f| %>
+ <%= render :partial => 'form', :locals => { :f => f } %>
+ <p><label><%= check_box_tag 'send_information', 1, true %> <%= l(:label_send_information) %></label></p>
+ <p>
+ <%= submit_tag l(:button_create) %>
+ <%= submit_tag l(:button_create_and_continue), :name => 'continue' %>
+ </p>
+<% end %>
users.with_options :conditions => {:method => :get} do |user_views|
user_views.connect 'users', :action => 'index'
user_views.connect 'users/:id', :action => 'show', :id => /\d+/
- user_views.connect 'users/new', :action => 'add'
+ user_views.connect 'users/new', :action => 'new'
user_views.connect 'users/:id/edit/:tab', :action => 'edit', :tab => nil
end
users.with_options :conditions => {:method => :post} do |user_actions|
- user_actions.connect 'users', :action => 'add'
user_actions.connect 'users/new', :action => 'create'
user_actions.connect 'users/:id/edit', :action => 'edit'
user_actions.connect 'users/:id/memberships', :action => 'edit_membership'
assert project_ids.include?(2) #private project admin can see
end
- context "GET :add" do
+ context "GET :new" do
setup do
- get :add
+ get :new
end
should_assign_to :user
should_respond_with :success
- should_render_template :add
+ should_render_template :new
end
context "POST :create" do
should_assign_to :user
should_respond_with :success
- should_render_template :add
+ should_render_template :new
end
end
def test_add_user
log_user("admin", "admin")
- get "/users/add"
+ get "/users/new"
assert_response :success
- assert_template "users/add"
+ assert_template "users/new"
post "/users/create", :user => { :login => "psmith", :firstname => "Paul", :lastname => "Smith", :mail => "psmith@somenet.foo", :language => "en" }, :password => "psmith09", :password_confirmation => "psmith09"
user = User.find_by_login("psmith")
context "users" do
should_route :get, "/users", :controller => 'users', :action => 'index'
should_route :get, "/users/44", :controller => 'users', :action => 'show', :id => '44'
- should_route :get, "/users/new", :controller => 'users', :action => 'add'
+ should_route :get, "/users/new", :controller => 'users', :action => 'new'
should_route :get, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444'
should_route :get, "/users/222/edit/membership", :controller => 'users', :action => 'edit', :id => '222', :tab => 'membership'