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