3
3
4
4
class ViewCustomizeViewHookTest < ActiveSupport ::TestCase
5
5
fixtures :projects , :users , :email_addresses , :user_preferences , :members , :member_roles , :roles ,
6
- :issues , :custom_fields , :custom_fields_projects , :custom_values ,
6
+ :issues , :journals , : custom_fields, :custom_fields_projects , :custom_values ,
7
7
:view_customizes
8
8
9
9
class Request
@@ -133,13 +133,13 @@ def test_view_issues_form_details_bottom
133
133
def test_view_issues_show_details_bottom
134
134
135
135
User . current = User . find ( 1 )
136
- issue = Issue . find ( 1 )
136
+ issue = Issue . find ( 4 )
137
137
138
138
expected = <<HTML
139
139
140
140
< script type =\" text/javascript\" >
141
141
//<![CDATA[
142
- ViewCustomize.context.issue = { id: 1 };
142
+ ViewCustomize.context.issue = {\" id \" :4, \" author \" :{ \" id \" :2, \" name \" : \" John Smith \" } };
143
143
//]]>
144
144
</ script>
145
145
<!-- view customize id:8 -->
@@ -148,7 +148,30 @@ def test_view_issues_show_details_bottom
148
148
</ style>
149
149
HTML
150
150
151
- html = @hook . view_issues_show_details_bottom ( { :request => Request . new ( "/issues/1" ) , :issue => issue , :project => @project_onlinestore } )
151
+ html = @hook . view_issues_show_details_bottom ( { :request => Request . new ( "/issues/4" ) , :issue => issue , :project => @project_onlinestore } )
152
+ assert_equal expected , html
153
+
154
+ end
155
+
156
+ def test_view_issues_show_details_bottom_with_journals
157
+
158
+ User . current = User . find ( 1 )
159
+ issue = Issue . find ( 6 )
160
+
161
+ expected = <<HTML
162
+
163
+ < script type =\" text/javascript\" >
164
+ //<![CDATA[
165
+ ViewCustomize.context.issue = {\" id\" :6,\" author\" :{\" id\" :2,\" name\" :\" John Smith\" },\" lastUpdatedBy\" :{\" id\" :1,\" name\" :\" Redmine Admin\" }};
166
+ //]]>
167
+ </ script>
168
+ <!-- view customize id:8 -->
169
+ < style type =\" text/css\" >
170
+ code_008
171
+ </ style>
172
+ HTML
173
+
174
+ html = @hook . view_issues_show_details_bottom ( { :request => Request . new ( "/issues/6" ) , :issue => issue , :project => @project_onlinestore } )
152
175
assert_equal expected , html
153
176
154
177
end
0 commit comments