3
3
4
4
class ViewCustomizeViewHookTest < ActiveSupport ::TestCase
5
5
fixtures :projects , :users , :email_addresses , :user_preferences , :members , :member_roles , :roles ,
6
- :issues , :journals , :custom_fields , :custom_fields_projects , :custom_values ,
6
+ :issues , :journals , :custom_fields , :custom_fields_projects , :custom_values , :time_entries ,
7
7
:view_customizes
8
8
9
9
class Request
@@ -170,7 +170,7 @@ def test_view_issues_show_details_bottom
170
170
171
171
< script type =\" text/javascript\" >
172
172
//<![CDATA[
173
- ViewCustomize.context.issue = {\" id\" :4,\" author\" :{\" id\" :2,\" name\" :\" John Smith\" }};
173
+ ViewCustomize.context.issue = {\" id\" :4,\" author\" :{\" id\" :2,\" name\" :\" John Smith\" }, \" totalEstimatedHours \" :null, \" totalSpentHours \" :0.0 };
174
174
//]]>
175
175
</ script>
176
176
<!-- view customize id:8 -->
@@ -193,7 +193,7 @@ def test_view_issues_show_details_bottom_with_journals
193
193
194
194
< script type =\" text/javascript\" >
195
195
//<![CDATA[
196
- ViewCustomize.context.issue = {\" id\" :6,\" author\" :{\" id\" :2,\" name\" :\" John Smith\" },\" lastUpdatedBy\" :{\" id\" :1,\" name\" :\" Redmine Admin\" }};
196
+ ViewCustomize.context.issue = {\" id\" :6,\" author\" :{\" id\" :2,\" name\" :\" John Smith\" },\" totalEstimatedHours \" :null, \" totalSpentHours \" :0.0, \" lastUpdatedBy\" :{\" id\" :1,\" name\" :\" Redmine Admin\" }};
197
197
//]]>
198
198
</ script>
199
199
<!-- view customize id:8 -->
@@ -207,4 +207,27 @@ def test_view_issues_show_details_bottom_with_journals
207
207
208
208
end
209
209
210
+ def test_view_issues_show_details_bottom_with_time_entries
211
+
212
+ User . current = User . find ( 1 )
213
+ issue = Issue . find ( 1 )
214
+
215
+ expected = <<HTML
216
+
217
+ < script type =\" text/javascript\" >
218
+ //<![CDATA[
219
+ ViewCustomize.context.issue = {\" id\" :1,\" author\" :{\" id\" :2,\" name\" :\" John Smith\" },\" totalEstimatedHours\" :200.0,\" totalSpentHours\" :154.25,\" lastUpdatedBy\" :{\" id\" :2,\" name\" :\" John Smith\" }};
220
+ //]]>
221
+ </ script>
222
+ <!-- view customize id:8 -->
223
+ < style type =\" text/css\" >
224
+ code_008
225
+ </ style>
226
+ HTML
227
+
228
+ html = @hook . view_issues_show_details_bottom ( { :request => Request . new ( "/issues/1" ) , :issue => issue , :project => @project_onlinestore } )
229
+ assert_equal expected , html
230
+
231
+ end
232
+
210
233
end
0 commit comments