@@ -71,7 +71,7 class UsersController < ApplicationController | |||
|
71 | 71 | render_404 |
|
72 | 72 | end |
|
73 | 73 | |
|
74 |
def |
|
|
74 | def new | |
|
75 | 75 | @notification_options = User::MAIL_NOTIFICATION_OPTIONS |
|
76 | 76 | @notification_option = Setting.default_notification_option |
|
77 | 77 | |
@@ -100,14 +100,14 class UsersController < ApplicationController | |||
|
100 | 100 | |
|
101 | 101 | Mailer.deliver_account_information(@user, params[:password]) if params[:send_information] |
|
102 | 102 | flash[:notice] = l(:notice_successful_create) |
|
103 |
redirect_to(params[:continue] ? {:controller => 'users', :action => ' |
|
|
103 | redirect_to(params[:continue] ? {:controller => 'users', :action => 'new'} : | |
|
104 | 104 | {:controller => 'users', :action => 'edit', :id => @user}) |
|
105 | 105 | return |
|
106 | 106 | else |
|
107 | 107 | @auth_sources = AuthSource.find(:all) |
|
108 | 108 | @notification_option = @user.mail_notification |
|
109 | 109 | |
|
110 |
render :action => ' |
|
|
110 | render :action => 'new' | |
|
111 | 111 | end |
|
112 | 112 | end |
|
113 | 113 |
@@ -1,5 +1,5 | |||
|
1 | 1 | <div class="contextual"> |
|
2 |
<%= link_to l(:label_user_new), {:action => ' |
|
|
2 | <%= link_to l(:label_user_new), {:action => 'new'}, :class => 'icon icon-add' %> | |
|
3 | 3 | </div> |
|
4 | 4 | |
|
5 | 5 | <h2><%=l(:label_user_plural)%></h2> |
|
1 | NO CONTENT: file renamed from app/views/users/add.rhtml to app/views/users/new.html.erb |
@@ -143,11 +143,10 ActionController::Routing::Routes.draw do |map| | |||
|
143 | 143 | users.with_options :conditions => {:method => :get} do |user_views| |
|
144 | 144 | user_views.connect 'users', :action => 'index' |
|
145 | 145 | user_views.connect 'users/:id', :action => 'show', :id => /\d+/ |
|
146 |
user_views.connect 'users/new', :action => ' |
|
|
146 | user_views.connect 'users/new', :action => 'new' | |
|
147 | 147 | user_views.connect 'users/:id/edit/:tab', :action => 'edit', :tab => nil |
|
148 | 148 | end |
|
149 | 149 | users.with_options :conditions => {:method => :post} do |user_actions| |
|
150 | user_actions.connect 'users', :action => 'add' | |
|
151 | 150 | user_actions.connect 'users/new', :action => 'create' |
|
152 | 151 | user_actions.connect 'users/:id/edit', :action => 'edit' |
|
153 | 152 | user_actions.connect 'users/:id/memberships', :action => 'edit_membership' |
@@ -107,14 +107,14 class UsersControllerTest < ActionController::TestCase | |||
|
107 | 107 | assert project_ids.include?(2) #private project admin can see |
|
108 | 108 | end |
|
109 | 109 | |
|
110 |
context "GET : |
|
|
110 | context "GET :new" do | |
|
111 | 111 | setup do |
|
112 |
get : |
|
|
112 | get :new | |
|
113 | 113 | end |
|
114 | 114 | |
|
115 | 115 | should_assign_to :user |
|
116 | 116 | should_respond_with :success |
|
117 |
should_render_template : |
|
|
117 | should_render_template :new | |
|
118 | 118 | end |
|
119 | 119 | |
|
120 | 120 | context "POST :create" do |
@@ -148,7 +148,7 class UsersControllerTest < ActionController::TestCase | |||
|
148 | 148 | |
|
149 | 149 | should_assign_to :user |
|
150 | 150 | should_respond_with :success |
|
151 |
should_render_template : |
|
|
151 | should_render_template :new | |
|
152 | 152 | end |
|
153 | 153 | |
|
154 | 154 | end |
@@ -22,9 +22,9 class AdminTest < ActionController::IntegrationTest | |||
|
22 | 22 | |
|
23 | 23 | def test_add_user |
|
24 | 24 | log_user("admin", "admin") |
|
25 |
get "/users/ |
|
|
25 | get "/users/new" | |
|
26 | 26 | assert_response :success |
|
27 |
assert_template "users/ |
|
|
27 | assert_template "users/new" | |
|
28 | 28 | post "/users/create", :user => { :login => "psmith", :firstname => "Paul", :lastname => "Smith", :mail => "psmith@somenet.foo", :language => "en" }, :password => "psmith09", :password_confirmation => "psmith09" |
|
29 | 29 | |
|
30 | 30 | user = User.find_by_login("psmith") |
@@ -246,7 +246,7 class RoutingTest < ActionController::IntegrationTest | |||
|
246 | 246 | context "users" do |
|
247 | 247 | should_route :get, "/users", :controller => 'users', :action => 'index' |
|
248 | 248 | should_route :get, "/users/44", :controller => 'users', :action => 'show', :id => '44' |
|
249 |
should_route :get, "/users/new", :controller => 'users', :action => ' |
|
|
249 | should_route :get, "/users/new", :controller => 'users', :action => 'new' | |
|
250 | 250 | should_route :get, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444' |
|
251 | 251 | should_route :get, "/users/222/edit/membership", :controller => 'users', :action => 'edit', :id => '222', :tab => 'membership' |
|
252 | 252 |
General Comments 0
You need to be logged in to leave comments.
Login now