##// END OF EJS Templates
remove trailing white-spaces from test/functional/context_menus_controller_test.rb....
Toshi MARUYAMA -
r6700:af5e18a1af48
parent child
Show More
@@ -1,119 +1,119
1 1 require File.expand_path('../../test_helper', __FILE__)
2 2
3 3 class ContextMenusControllerTest < ActionController::TestCase
4 4 fixtures :all
5 5
6 6 def test_context_menu_one_issue
7 7 @request.session[:user_id] = 2
8 8 get :issues, :ids => [1]
9 9 assert_response :success
10 10 assert_template 'context_menu'
11 11 assert_tag :tag => 'a', :content => 'Edit',
12 12 :attributes => { :href => '/issues/1/edit',
13 13 :class => 'icon-edit' }
14 14 assert_tag :tag => 'a', :content => 'Closed',
15 15 :attributes => { :href => '/issues/bulk_edit?ids%5B%5D=1&amp;issue%5Bstatus_id%5D=5',
16 16 :class => '' }
17 17 assert_tag :tag => 'a', :content => 'Immediate',
18 18 :attributes => { :href => '/issues/bulk_edit?ids%5B%5D=1&amp;issue%5Bpriority_id%5D=8',
19 19 :class => '' }
20 20 assert_no_tag :tag => 'a', :content => 'Inactive Priority'
21 21 # Versions
22 22 assert_tag :tag => 'a', :content => '2.0',
23 23 :attributes => { :href => '/issues/bulk_edit?ids%5B%5D=1&amp;issue%5Bfixed_version_id%5D=3',
24 24 :class => '' }
25 25 assert_tag :tag => 'a', :content => 'eCookbook Subproject 1 - 2.0',
26 26 :attributes => { :href => '/issues/bulk_edit?ids%5B%5D=1&amp;issue%5Bfixed_version_id%5D=4',
27 27 :class => '' }
28 28
29 29 assert_tag :tag => 'a', :content => 'Dave Lopper',
30 30 :attributes => { :href => '/issues/bulk_edit?ids%5B%5D=1&amp;issue%5Bassigned_to_id%5D=3',
31 31 :class => '' }
32 32 assert_tag :tag => 'a', :content => 'Duplicate',
33 33 :attributes => { :href => '/projects/ecookbook/issues/1/copy',
34 34 :class => 'icon-duplicate' }
35 35 assert_tag :tag => 'a', :content => 'Copy',
36 36 :attributes => { :href => '/issues/move/new?copy_options%5Bcopy%5D=t&amp;ids%5B%5D=1',
37 37 :class => 'icon-copy' }
38 38 assert_tag :tag => 'a', :content => 'Move',
39 39 :attributes => { :href => '/issues/move/new?ids%5B%5D=1',
40 40 :class => 'icon-move' }
41 41 assert_tag :tag => 'a', :content => 'Delete',
42 42 :attributes => { :href => '/issues/destroy?ids%5B%5D=1',
43 43 :class => 'icon-del' }
44 44 end
45 45
46 46 def test_context_menu_one_issue_by_anonymous
47 47 get :issues, :ids => [1]
48 48 assert_response :success
49 49 assert_template 'context_menu'
50 50 assert_tag :tag => 'a', :content => 'Delete',
51 51 :attributes => { :href => '#',
52 52 :class => 'icon-del disabled' }
53 53 end
54
54
55 55 def test_context_menu_multiple_issues_of_same_project
56 56 @request.session[:user_id] = 2
57 57 get :issues, :ids => [1, 2]
58 58 assert_response :success
59 59 assert_template 'context_menu'
60 60 assert_not_nil assigns(:issues)
61 61 assert_equal [1, 2], assigns(:issues).map(&:id).sort
62
62
63 63 ids = assigns(:issues).map(&:id).map {|i| "ids%5B%5D=#{i}"}.join('&amp;')
64 64 assert_tag :tag => 'a', :content => 'Edit',
65 65 :attributes => { :href => "/issues/bulk_edit?#{ids}",
66 66 :class => 'icon-edit' }
67 67 assert_tag :tag => 'a', :content => 'Closed',
68 68 :attributes => { :href => "/issues/bulk_edit?#{ids}&amp;issue%5Bstatus_id%5D=5",
69 69 :class => '' }
70 70 assert_tag :tag => 'a', :content => 'Immediate',
71 71 :attributes => { :href => "/issues/bulk_edit?#{ids}&amp;issue%5Bpriority_id%5D=8",
72 72 :class => '' }
73 73 assert_tag :tag => 'a', :content => 'Dave Lopper',
74 74 :attributes => { :href => "/issues/bulk_edit?#{ids}&amp;issue%5Bassigned_to_id%5D=3",
75 75 :class => '' }
76 76 assert_tag :tag => 'a', :content => 'Copy',
77 77 :attributes => { :href => "/issues/move/new?copy_options%5Bcopy%5D=t&amp;#{ids}",
78 78 :class => 'icon-copy' }
79 79 assert_tag :tag => 'a', :content => 'Move',
80 80 :attributes => { :href => "/issues/move/new?#{ids}",
81 81 :class => 'icon-move' }
82 82 assert_tag :tag => 'a', :content => 'Delete',
83 83 :attributes => { :href => "/issues/destroy?#{ids}",
84 84 :class => 'icon-del' }
85 85 end
86 86
87 87 def test_context_menu_multiple_issues_of_different_projects
88 88 @request.session[:user_id] = 2
89 89 get :issues, :ids => [1, 2, 6]
90 90 assert_response :success
91 91 assert_template 'context_menu'
92 92 assert_not_nil assigns(:issues)
93 93 assert_equal [1, 2, 6], assigns(:issues).map(&:id).sort
94
94
95 95 ids = assigns(:issues).map(&:id).map {|i| "ids%5B%5D=#{i}"}.join('&amp;')
96 96 assert_tag :tag => 'a', :content => 'Edit',
97 97 :attributes => { :href => "/issues/bulk_edit?#{ids}",
98 98 :class => 'icon-edit' }
99 99 assert_tag :tag => 'a', :content => 'Closed',
100 100 :attributes => { :href => "/issues/bulk_edit?#{ids}&amp;issue%5Bstatus_id%5D=5",
101 101 :class => '' }
102 102 assert_tag :tag => 'a', :content => 'Immediate',
103 103 :attributes => { :href => "/issues/bulk_edit?#{ids}&amp;issue%5Bpriority_id%5D=8",
104 104 :class => '' }
105 105 assert_tag :tag => 'a', :content => 'John Smith',
106 106 :attributes => { :href => "/issues/bulk_edit?#{ids}&amp;issue%5Bassigned_to_id%5D=2",
107 107 :class => '' }
108 108 assert_tag :tag => 'a', :content => 'Delete',
109 109 :attributes => { :href => "/issues/destroy?#{ids}",
110 110 :class => 'icon-del' }
111 111 end
112
112
113 113 def test_context_menu_issue_visibility
114 114 get :issues, :ids => [1, 4]
115 115 assert_response :success
116 116 assert_template 'context_menu'
117 117 assert_equal [1], assigns(:issues).collect(&:id)
118 118 end
119 119 end
General Comments 0
You need to be logged in to leave comments. Login now