]> source.dussan.org Git - redmine.git/commitdiff
Missing "next" pagination link when looking at yesterday's activity (#18399).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 4 Jan 2017 21:13:28 +0000 (21:13 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 4 Jan 2017 21:13:28 +0000 (21:13 +0000)
Patch by Felix Schäfer.

git-svn-id: http://svn.redmine.org/redmine/trunk@16137 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/activities/index.html.erb
test/functional/activities_controller_test.rb

index f86390ab34c6bd1fd8eff33bca1a1e1024ae5ccf..c3026fb63e0283c91323b76b81f20a78b964b2fb 100644 (file)
@@ -28,7 +28,7 @@
                    {:params => request.query_parameters.merge(:from => @date_to - @days - 1)},
                    :title => l(:label_date_from_to, :start => format_date(@date_to - 2*@days), :end => format_date(@date_to - @days - 1)),
                    :accesskey => accesskey(:previous)) %>
-    </li><% unless @date_to >= User.current.today %><li class="next page">
+    </li><% unless @date_to > User.current.today %><li class="next page">
 <%= link_to(l(:label_next) + " \xc2\xbb",
                    {:params => request.query_parameters.merge(:from => @date_to + @days - 1)},
                    :title => l(:label_date_from_to, :start => format_date(@date_to), :end => format_date(@date_to + @days - 1)),
index 5aacf622896cd633dcb953b9f642e2d4d7790363..230e46192b31fbca942feb599676dbdad6c857a3 100644 (file)
@@ -169,4 +169,22 @@ class ActivitiesControllerTest < Redmine::ControllerTest
       assert_select 'input[name=show_news][checked=checked]'
     end
   end
+
+  def test_index_should_not_show_next_page_link
+    @request.session[:user_id] = 2
+
+    get :index
+    assert_response :success
+    assert_select '.pagination a', :text => /Previous/
+    assert_select '.pagination a', :text => /Next/, :count => 0
+  end
+
+  def test_index_up_to_yesterday_should_show_next_page_link
+    @request.session[:user_id] = 2
+
+    get :index, :from => (User.find(2).today-1)
+    assert_response :success
+    assert_select '.pagination a', :text => /Previous/
+    assert_select '.pagination a', :text => /Next/
+  end
 end