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