@@ -21,11 +21,11 class AccountTest < Redmine::IntegrationTest | |||
|
21 | 21 | fixtures :users, :roles |
|
22 | 22 | |
|
23 | 23 | def test_login |
|
24 | get "my/page" | |
|
24 | get "/my/page" | |
|
25 | 25 | assert_redirected_to "/login?back_url=http%3A%2F%2Fwww.example.com%2Fmy%2Fpage" |
|
26 | 26 | log_user('jsmith', 'jsmith') |
|
27 | 27 | |
|
28 | get "my/account" | |
|
28 | get "/my/account" | |
|
29 | 29 | assert_response :success |
|
30 | 30 | assert_template "my/account" |
|
31 | 31 | end |
@@ -91,12 +91,12 class AccountTest < Redmine::IntegrationTest | |||
|
91 | 91 | def test_lost_password |
|
92 | 92 | Token.delete_all |
|
93 | 93 | |
|
94 | get "account/lost_password" | |
|
94 | get "/account/lost_password" | |
|
95 | 95 | assert_response :success |
|
96 | 96 | assert_template "account/lost_password" |
|
97 | 97 | assert_select 'input[name=mail]' |
|
98 | 98 | |
|
99 | post "account/lost_password", :mail => 'jSmith@somenet.foo' | |
|
99 | post "/account/lost_password", :mail => 'jSmith@somenet.foo' | |
|
100 | 100 | assert_redirected_to "/login" |
|
101 | 101 | |
|
102 | 102 | token = Token.first |
@@ -104,14 +104,14 class AccountTest < Redmine::IntegrationTest | |||
|
104 | 104 | assert_equal 'jsmith@somenet.foo', token.user.mail |
|
105 | 105 | assert !token.expired? |
|
106 | 106 | |
|
107 | get "account/lost_password", :token => token.value | |
|
107 | get "/account/lost_password", :token => token.value | |
|
108 | 108 | assert_response :success |
|
109 | 109 | assert_template "account/password_recovery" |
|
110 | 110 | assert_select 'input[type=hidden][name=token][value=?]', token.value |
|
111 | 111 | assert_select 'input[name=new_password]' |
|
112 | 112 | assert_select 'input[name=new_password_confirmation]' |
|
113 | 113 | |
|
114 | post "account/lost_password", | |
|
114 | post "/account/lost_password", | |
|
115 | 115 | :token => token.value, :new_password => 'newpass123', |
|
116 | 116 | :new_password_confirmation => 'newpass123' |
|
117 | 117 | assert_redirected_to "/login" |
@@ -153,11 +153,11 class AccountTest < Redmine::IntegrationTest | |||
|
153 | 153 | def test_register_with_automatic_activation |
|
154 | 154 | Setting.self_registration = '3' |
|
155 | 155 | |
|
156 | get 'account/register' | |
|
156 | get '/account/register' | |
|
157 | 157 | assert_response :success |
|
158 | 158 | assert_template 'account/register' |
|
159 | 159 | |
|
160 | post 'account/register', | |
|
160 | post '/account/register', | |
|
161 | 161 | :user => {:login => "newuser", :language => "en", |
|
162 | 162 | :firstname => "New", :lastname => "User", :mail => "newuser@foo.bar", |
|
163 | 163 | :password => "newpass123", :password_confirmation => "newpass123"} |
@@ -175,7 +175,7 class AccountTest < Redmine::IntegrationTest | |||
|
175 | 175 | def test_register_with_manual_activation |
|
176 | 176 | Setting.self_registration = '2' |
|
177 | 177 | |
|
178 | post 'account/register', | |
|
178 | post '/account/register', | |
|
179 | 179 | :user => {:login => "newuser", :language => "en", |
|
180 | 180 | :firstname => "New", :lastname => "User", :mail => "newuser@foo.bar", |
|
181 | 181 | :password => "newpass123", :password_confirmation => "newpass123"} |
@@ -187,7 +187,7 class AccountTest < Redmine::IntegrationTest | |||
|
187 | 187 | Setting.self_registration = '1' |
|
188 | 188 | Token.delete_all |
|
189 | 189 | |
|
190 | post 'account/register', | |
|
190 | post '/account/register', | |
|
191 | 191 | :user => {:login => "newuser", :language => "en", |
|
192 | 192 | :firstname => "New", :lastname => "User", :mail => "newuser@foo.bar", |
|
193 | 193 | :password => "newpass123", :password_confirmation => "newpass123"} |
@@ -199,7 +199,7 class AccountTest < Redmine::IntegrationTest | |||
|
199 | 199 | assert_equal 'newuser@foo.bar', token.user.mail |
|
200 | 200 | assert !token.expired? |
|
201 | 201 | |
|
202 | get 'account/activate', :token => token.value | |
|
202 | get '/account/activate', :token => token.value | |
|
203 | 203 | assert_redirected_to '/login' |
|
204 | 204 | log_user('newuser', 'newpass123') |
|
205 | 205 | end |
@@ -234,7 +234,7 class AccountTest < Redmine::IntegrationTest | |||
|
234 | 234 | assert_select 'input[name=?]', 'user[login]', 0 |
|
235 | 235 | assert_select 'input[name=?]', 'user[password]', 0 |
|
236 | 236 | |
|
237 | post 'account/register', | |
|
237 | post '/account/register', | |
|
238 | 238 | :user => {:firstname => 'Foo', :lastname => 'Smith', :mail => 'foo@bar.com'} |
|
239 | 239 | assert_redirected_to '/my/account' |
|
240 | 240 | |
@@ -251,7 +251,7 class AccountTest < Redmine::IntegrationTest | |||
|
251 | 251 | # register a new account |
|
252 | 252 | assert_difference 'User.count' do |
|
253 | 253 | assert_difference 'Token.count' do |
|
254 | post 'account/register', | |
|
254 | post '/account/register', | |
|
255 | 255 | :user => {:login => "newuser", :language => "en", |
|
256 | 256 | :firstname => "New", :lastname => "User", :mail => "newuser@foo.bar", |
|
257 | 257 | :password => "newpass123", :password_confirmation => "newpass123"} |
@@ -45,7 +45,7 class AdminTest < Redmine::IntegrationTest | |||
|
45 | 45 | assert_kind_of User, logged_user |
|
46 | 46 | assert_equal "Paul", logged_user.firstname |
|
47 | 47 | |
|
48 | put "users/#{user.id}", :id => user.id, :user => { :status => User::STATUS_LOCKED } | |
|
48 | put "/users/#{user.id}", :id => user.id, :user => { :status => User::STATUS_LOCKED } | |
|
49 | 49 | assert_redirected_to "/users/#{ user.id }/edit" |
|
50 | 50 | locked_user = User.try_to_login("psmith", "psmith09") |
|
51 | 51 | assert_equal nil, locked_user |
@@ -32,21 +32,21 class ApplicationTest < Redmine::IntegrationTest | |||
|
32 | 32 | Setting.default_language = 'en' |
|
33 | 33 | |
|
34 | 34 | # a french user |
|
35 | get 'projects', { }, 'HTTP_ACCEPT_LANGUAGE' => 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3' | |
|
35 | get '/projects', { }, 'HTTP_ACCEPT_LANGUAGE' => 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3' | |
|
36 | 36 | assert_response :success |
|
37 | 37 | assert_select 'h2', :text => 'Projets' |
|
38 | 38 | assert_equal :fr, current_language |
|
39 | 39 | assert_select "html[lang=?]", "fr" |
|
40 | 40 | |
|
41 | 41 | # then an italien user |
|
42 | get 'projects', { }, 'HTTP_ACCEPT_LANGUAGE' => 'it;q=0.8,en-us;q=0.5,en;q=0.3' | |
|
42 | get '/projects', { }, 'HTTP_ACCEPT_LANGUAGE' => 'it;q=0.8,en-us;q=0.5,en;q=0.3' | |
|
43 | 43 | assert_response :success |
|
44 | 44 | assert_select 'h2', :text => 'Progetti' |
|
45 | 45 | assert_equal :it, current_language |
|
46 | 46 | assert_select "html[lang=?]", "it" |
|
47 | 47 | |
|
48 | 48 | # not a supported language: default language should be used |
|
49 | get 'projects', { }, 'HTTP_ACCEPT_LANGUAGE' => 'zz' | |
|
49 | get '/projects', { }, 'HTTP_ACCEPT_LANGUAGE' => 'zz' | |
|
50 | 50 | assert_response :success |
|
51 | 51 | assert_select 'h2', :text => 'Projects' |
|
52 | 52 | assert_select "html[lang=?]", "en" |
@@ -54,11 +54,11 class ApplicationTest < Redmine::IntegrationTest | |||
|
54 | 54 | |
|
55 | 55 | def test_token_based_access_should_not_start_session |
|
56 | 56 | # issue of a private project |
|
57 | get 'issues/4.atom' | |
|
57 | get '/issues/4.atom' | |
|
58 | 58 | assert_response 302 |
|
59 | 59 | |
|
60 | 60 | rss_key = User.find(2).rss_key |
|
61 | get "issues/4.atom?key=#{rss_key}" | |
|
61 | get "/issues/4.atom?key=#{rss_key}" | |
|
62 | 62 | assert_response 200 |
|
63 | 63 | assert_nil session[:user_id] |
|
64 | 64 | end |
@@ -80,7 +80,7 class ApplicationTest < Redmine::IntegrationTest | |||
|
80 | 80 | def test_localization_should_be_set_correctly_on_invalid_token |
|
81 | 81 | ActionController::Base.allow_forgery_protection = true |
|
82 | 82 | Setting.default_language = 'en' |
|
83 | post 'issues', { }, 'HTTP_ACCEPT_LANGUAGE' => 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3' | |
|
83 | post '/issues', { }, 'HTTP_ACCEPT_LANGUAGE' => 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3' | |
|
84 | 84 | assert_response 422 |
|
85 | 85 | assert_equal :fr, current_language |
|
86 | 86 | assert_select "html[lang=?]", "fr" |
@@ -36,11 +36,11 class IssuesTest < Redmine::IntegrationTest | |||
|
36 | 36 | # create an issue |
|
37 | 37 | def test_add_issue |
|
38 | 38 | log_user('jsmith', 'jsmith') |
|
39 | get 'projects/1/issues/new', :tracker_id => '1' | |
|
39 | get '/projects/1/issues/new', :tracker_id => '1' | |
|
40 | 40 | assert_response :success |
|
41 | 41 | assert_template 'issues/new' |
|
42 | 42 | |
|
43 | post 'projects/1/issues', :tracker_id => "1", | |
|
43 | post '/projects/1/issues', :tracker_id => "1", | |
|
44 | 44 | :issue => { :start_date => "2006-12-26", |
|
45 | 45 | :priority_id => "4", |
|
46 | 46 | :subject => "new test issue", |
@@ -69,7 +69,7 class IssuesTest < Redmine::IntegrationTest | |||
|
69 | 69 | Role.anonymous.remove_permission! :add_issues |
|
70 | 70 | |
|
71 | 71 | assert_no_difference 'Issue.count' do |
|
72 | post 'projects/1/issues', :tracker_id => "1", :issue => {:subject => "new test issue"} | |
|
72 | post '/projects/1/issues', :tracker_id => "1", :issue => {:subject => "new test issue"} | |
|
73 | 73 | end |
|
74 | 74 | assert_response 302 |
|
75 | 75 | end |
@@ -79,7 +79,7 class IssuesTest < Redmine::IntegrationTest | |||
|
79 | 79 | Member.create!(:project_id => 1, :principal => Group.anonymous, :role_ids => [3]) |
|
80 | 80 | |
|
81 | 81 | assert_difference 'Issue.count' do |
|
82 | post 'projects/1/issues', :tracker_id => "1", :issue => {:subject => "new test issue"} | |
|
82 | post '/projects/1/issues', :tracker_id => "1", :issue => {:subject => "new test issue"} | |
|
83 | 83 | end |
|
84 | 84 | assert_response 302 |
|
85 | 85 | issue = Issue.order("id DESC").first |
@@ -91,7 +91,7 class IssuesTest < Redmine::IntegrationTest | |||
|
91 | 91 | log_user('jsmith', 'jsmith') |
|
92 | 92 | set_tmp_attachments_directory |
|
93 | 93 | |
|
94 | put 'issues/1', | |
|
94 | put '/issues/1', | |
|
95 | 95 | :notes => 'Some notes', |
|
96 | 96 | :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'This is an attachment'}} |
|
97 | 97 | assert_redirected_to "/issues/1" |
@@ -29,7 +29,7 class MenuManagerTest < Redmine::IntegrationTest | |||
|
29 | 29 | :enabled_modules |
|
30 | 30 | |
|
31 | 31 | def test_project_menu_with_specific_locale |
|
32 | get 'projects/ecookbook/issues', { }, 'HTTP_ACCEPT_LANGUAGE' => 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3' | |
|
32 | get '/projects/ecookbook/issues', { }, 'HTTP_ACCEPT_LANGUAGE' => 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3' | |
|
33 | 33 | |
|
34 | 34 | assert_select 'div#main-menu' do |
|
35 | 35 | assert_select 'li a.activity[href=?]', '/projects/ecookbook/activity', :text => ll('fr', :label_activity) |
@@ -46,7 +46,7 class MenuManagerTest < Redmine::IntegrationTest | |||
|
46 | 46 | menu.push :hello, { :controller => 'projects', :action => 'show' }, :caption => Proc.new {|p| p.name.upcase }, :after => :bar |
|
47 | 47 | end |
|
48 | 48 | |
|
49 | get 'projects/ecookbook' | |
|
49 | get '/projects/ecookbook' | |
|
50 | 50 | |
|
51 | 51 | assert_select 'div#main-menu ul' do |
|
52 | 52 | assert_select 'li:last-child a.foo[href=?]', '/projects/ecookbook', :text => 'Foo' |
@@ -23,22 +23,22 class ProjectsTest < Redmine::IntegrationTest | |||
|
23 | 23 | def test_archive_project |
|
24 | 24 | subproject = Project.find(1).children.first |
|
25 | 25 | log_user("admin", "admin") |
|
26 | get "admin/projects" | |
|
26 | get "/admin/projects" | |
|
27 | 27 | assert_response :success |
|
28 | 28 | assert_template "admin/projects" |
|
29 | post "projects/1/archive" | |
|
29 | post "/projects/1/archive" | |
|
30 | 30 | assert_redirected_to "/admin/projects" |
|
31 | 31 | assert !Project.find(1).active? |
|
32 | 32 | |
|
33 | get 'projects/1' | |
|
33 | get '/projects/1' | |
|
34 | 34 | assert_response 403 |
|
35 | get "projects/#{subproject.id}" | |
|
35 | get "/projects/#{subproject.id}" | |
|
36 | 36 | assert_response 403 |
|
37 | 37 | |
|
38 | post "projects/1/unarchive" | |
|
38 | post "/projects/1/unarchive" | |
|
39 | 39 | assert_redirected_to "/admin/projects" |
|
40 | 40 | assert Project.find(1).active? |
|
41 | get "projects/1" | |
|
41 | get "/projects/1" | |
|
42 | 42 | assert_response :success |
|
43 | 43 | end |
|
44 | 44 |
General Comments 0
You need to be logged in to leave comments.
Login now