@@ -1,42 +1,43 | |||||
1 | # Redmine - project management software |
|
1 | # Redmine - project management software | |
2 | # Copyright (C) 2006-2014 Jean-Philippe Lang |
|
2 | # Copyright (C) 2006-2014 Jean-Philippe Lang | |
3 | # |
|
3 | # | |
4 | # This program is free software; you can redistribute it and/or |
|
4 | # This program is free software; you can redistribute it and/or | |
5 | # modify it under the terms of the GNU General Public License |
|
5 | # modify it under the terms of the GNU General Public License | |
6 | # as published by the Free Software Foundation; either version 2 |
|
6 | # as published by the Free Software Foundation; either version 2 | |
7 | # of the License, or (at your option) any later version. |
|
7 | # of the License, or (at your option) any later version. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU General Public License |
|
14 | # You should have received a copy of the GNU General Public License | |
15 | # along with this program; if not, write to the Free Software |
|
15 | # along with this program; if not, write to the Free Software | |
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
17 |
|
17 | |||
18 | require File.expand_path('../../../test_helper', __FILE__) |
|
18 | require File.expand_path('../../../test_helper', __FILE__) | |
19 |
|
19 | |||
20 | class MembersHelperTest < ActionView::TestCase |
|
20 | class MembersHelperTest < ActionView::TestCase | |
21 | include Redmine::I18n |
|
21 | include Redmine::I18n | |
22 | include ERB::Util |
|
22 | include ERB::Util | |
23 | include MembersHelper |
|
23 | include MembersHelper | |
24 |
|
24 | |||
25 | fixtures :projects, :users, :members, :member_roles |
|
25 | fixtures :projects, :users, :members, :member_roles, | |
|
26 | :trackers, :issue_statuses | |||
26 |
|
27 | |||
27 | def test_render_principals_for_new_members |
|
28 | def test_render_principals_for_new_members | |
28 | project = Project.generate! |
|
29 | project = Project.generate! | |
29 |
|
30 | |||
30 | result = render_principals_for_new_members(project) |
|
31 | result = render_principals_for_new_members(project) | |
31 | assert_select_in result, 'input[name=?][value=2]', 'membership[user_ids][]' |
|
32 | assert_select_in result, 'input[name=?][value=2]', 'membership[user_ids][]' | |
32 | end |
|
33 | end | |
33 |
|
34 | |||
34 | def test_render_principals_for_new_members_with_limited_results_should_paginate |
|
35 | def test_render_principals_for_new_members_with_limited_results_should_paginate | |
35 | project = Project.generate! |
|
36 | project = Project.generate! | |
36 |
|
37 | |||
37 | result = render_principals_for_new_members(project, 3) |
|
38 | result = render_principals_for_new_members(project, 3) | |
38 | assert_select_in result, 'p.pagination' |
|
39 | assert_select_in result, 'p.pagination' | |
39 | assert_select_in result, 'span.current.page', :text => '1' |
|
40 | assert_select_in result, 'span.current.page', :text => '1' | |
40 | assert_select_in result, 'a[href=?]', "/projects/#{project.identifier}/memberships/autocomplete.js?page=2", :text => '2' |
|
41 | assert_select_in result, 'a[href=?]', "/projects/#{project.identifier}/memberships/autocomplete.js?page=2", :text => '2' | |
41 | end |
|
42 | end | |
42 | end |
|
43 | end |
General Comments 0
You need to be logged in to leave comments.
Login now