]> source.dussan.org Git - redmine.git/commitdiff
Adds a link on "My Page" to view all my spent time (#13157).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 18 May 2013 07:39:26 +0000 (07:39 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 18 May 2013 07:39:26 +0000 (07:39 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11859 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/my/blocks/_timelog.html.erb
test/functional/timelog_controller_test.rb

index be8e05e35abed74998990148a99f5ca819137d2f..7953ee6fe7e8119086b257be707f16fd07d7e47e 100644 (file)
@@ -1,4 +1,7 @@
-<h3><%=l(:label_spent_time)%> (<%= l(:label_last_n_days, 7) %>)</h3>
+<h3>
+  <%= link_to l(:label_spent_time), time_entries_path(:user_id => 'me') %>
+  (<%= l(:label_last_n_days, 7) %>)
+</h3>
 <%
 entries = timelog_items
 entries_by_day = entries.group_by(&:spent_on)
index 7b9c9e891b0219e45cfcadf2bef2189b0b798f77..2cc9bf778d4191d9665547e0a9fc07ceb68bc225 100644 (file)
@@ -429,6 +429,14 @@ class TimelogControllerTest < ActionController::TestCase
     assert_tag 'a', :attributes => {:href => '/time_entries/new'}, :content => /Log time/
   end
 
+  def test_index_my_spent_time
+    @request.session[:user_id] = 2
+    get :index, :user_id => 'me'
+    assert_response :success
+    assert_template 'index'
+    assert assigns(:entries).all? {|entry| entry.user_id == 2}
+  end
+
   def test_index_at_project_level
     get :index, :project_id => 'ecookbook'
     assert_response :success