33
44class  ViewCustomizeViewHookTest  < ActiveSupport ::TestCase 
55  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 , 
77           :view_customizes 
88
99  class  Request 
@@ -170,7 +170,7 @@ def test_view_issues_show_details_bottom
170170
171171< script  type =\" text/javascript\" > 
172172//<![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 }; 
174174//]]>  
175175</ script> 
176176<!-- view customize id:8 --> 
@@ -193,7 +193,7 @@ def test_view_issues_show_details_bottom_with_journals
193193
194194< script  type =\" text/javascript\" > 
195195//<![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\" }}; 
197197//]]>  
198198</ script> 
199199<!-- view customize id:8 --> 
@@ -207,4 +207,27 @@ def test_view_issues_show_details_bottom_with_journals
207207
208208  end 
209209
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+ 
210233end 
0 commit comments