@@ -31,7 +31,7 entries_by_day = entries.group_by(&:spent_on) | |||||
31 | <% entries_by_day[day].each do |entry| -%> |
|
31 | <% entries_by_day[day].each do |entry| -%> | |
32 | <tr class="time-entry" style="border-bottom: 1px solid #f5f5f5;"> |
|
32 | <tr class="time-entry" style="border-bottom: 1px solid #f5f5f5;"> | |
33 | <td class="activity"><%=h entry.activity %></td> |
|
33 | <td class="activity"><%=h entry.activity %></td> | |
34 | <td class="subject"><%=h entry.project %> <%= ' - ' + link_to_issue(entry.issue, :truncate => 50) if entry.issue %></td> |
|
34 | <td class="subject"><%=h entry.project %> <%= h(' - ') + link_to_issue(entry.issue, :truncate => 50) if entry.issue %></td> | |
35 | <td class="comments"><%=h entry.comments %></td> |
|
35 | <td class="comments"><%=h entry.comments %></td> | |
36 | <td class="hours"><%= html_hours("%.2f" % entry.hours) %></td> |
|
36 | <td class="hours"><%= html_hours("%.2f" % entry.hours) %></td> | |
37 | <td align="center"> |
|
37 | <td align="center"> |
@@ -22,7 +22,8 require 'my_controller' | |||||
22 | class MyController; def rescue_action(e) raise e end; end |
|
22 | class MyController; def rescue_action(e) raise e end; end | |
23 |
|
23 | |||
24 | class MyControllerTest < ActionController::TestCase |
|
24 | class MyControllerTest < ActionController::TestCase | |
25 |
fixtures :users, :user_preferences, :roles, :projects, : |
|
25 | fixtures :users, :user_preferences, :roles, :projects, :members, :member_roles, | |
|
26 | :issues, :issue_statuses, :trackers, :enumerations, :custom_fields, :auth_sources | |||
26 |
|
27 | |||
27 | def setup |
|
28 | def setup | |
28 | @controller = MyController.new |
|
29 | @controller = MyController.new | |
@@ -43,6 +44,20 class MyControllerTest < ActionController::TestCase | |||||
43 | assert_template 'page' |
|
44 | assert_template 'page' | |
44 | end |
|
45 | end | |
45 |
|
46 | |||
|
47 | def test_page_with_timelog_block | |||
|
48 | preferences = User.find(2).pref | |||
|
49 | preferences[:my_page_layout] = {'top' => ['timelog']} | |||
|
50 | preferences.save! | |||
|
51 | TimeEntry.create!(:user => User.find(2), :spent_on => Date.yesterday, :issue_id => 1, :hours => 2.5, :activity_id => 10) | |||
|
52 | ||||
|
53 | get :page | |||
|
54 | assert_response :success | |||
|
55 | assert_select 'tr.time-entry' do | |||
|
56 | assert_select 'td.subject a[href=/issues/1]' | |||
|
57 | assert_select 'td.hours', :text => '2.50' | |||
|
58 | end | |||
|
59 | end | |||
|
60 | ||||
46 | def test_my_account_should_show_editable_custom_fields |
|
61 | def test_my_account_should_show_editable_custom_fields | |
47 | get :account |
|
62 | get :account | |
48 | assert_response :success |
|
63 | assert_response :success |
General Comments 0
You need to be logged in to leave comments.
Login now