diff --git a/app/views/activities/index.html.erb b/app/views/activities/index.html.erb
index f86390a..c3026fb 100644
--- a/app/views/activities/index.html.erb
+++ b/app/views/activities/index.html.erb
@@ -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)) %>
- <% unless @date_to >= User.current.today %>
+ <% unless @date_to > User.current.today %>
<%= 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)),
diff --git a/test/functional/activities_controller_test.rb b/test/functional/activities_controller_test.rb
index 5aacf62..230e461 100644
--- a/test/functional/activities_controller_test.rb
+++ b/test/functional/activities_controller_test.rb
@@ -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