summaryrefslogtreecommitdiffstats
path: root/test/functional/activities_controller_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-11-24 05:27:29 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-11-24 05:27:29 +0000
commit7a24a790df6edc3cb44cb2e12ea057bac1617a99 (patch)
treee0473cd806cc763861c17c2602ba84a71cc2d41b /test/functional/activities_controller_test.rb
parente5e0c52768ac48edc8aca70e1b35aef7fdae0aff (diff)
downloadredmine-7a24a790df6edc3cb44cb2e12ea057bac1617a99.tar.gz
redmine-7a24a790df6edc3cb44cb2e12ea057bac1617a99.zip
cleanup: rubocop: fix Layout/IndentFirstHashElement in test/functional/activities_controller_test.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@19234 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/activities_controller_test.rb')
-rw-r--r--test/functional/activities_controller_test.rb61
1 files changed, 42 insertions, 19 deletions
diff --git a/test/functional/activities_controller_test.rb b/test/functional/activities_controller_test.rb
index 8d6cc3aca..07dad2091 100644
--- a/test/functional/activities_controller_test.rb
+++ b/test/functional/activities_controller_test.rb
@@ -31,10 +31,13 @@ class ActivitiesControllerTest < Redmine::ControllerTest
:journals, :journal_details
def test_project_index
- get :index, :params => {
+ get(
+ :index,
+ :params => {
:id => 1,
:with_subprojects => 0
}
+ )
assert_response :success
assert_select 'h3', :text => /#{2.days.ago.to_date.day}/
@@ -42,18 +45,19 @@ class ActivitiesControllerTest < Redmine::ControllerTest
end
def test_project_index_with_invalid_project_id_should_respond_404
- get :index, :params => {
- :id => 299
- }
+ get(:index, :params => {:id => 299})
assert_response 404
end
def test_previous_project_index
@request.session[:user_id] = 1
- get :index, :params => {
+ get(
+ :index,
+ :params => {
:id => 1,
:from => 2.days.ago.to_date
}
+ )
assert_response :success
assert_select 'h3', :text => /#{User.current.time_to_date(3.days.ago).day}/
@@ -74,9 +78,12 @@ class ActivitiesControllerTest < Redmine::ControllerTest
def test_user_index
@request.session[:user_id] = 1
- get :index, :params => {
+ get(
+ :index,
+ :params => {
:user_id => 2
}
+ )
assert_response :success
assert_select 'h2 a[href="/users/2"]', :text => 'John Smith'
@@ -89,17 +96,23 @@ class ActivitiesControllerTest < Redmine::ControllerTest
end
def test_user_index_with_invalid_user_id_should_respond_404
- get :index, :params => {
+ get(
+ :index,
+ :params => {
:user_id => 299
}
+ )
assert_response 404
end
def test_index_atom_feed
- get :index, :params => {
+ get(
+ :index,
+ :params => {
:format => 'atom',
:with_subprojects => 0
}
+ )
assert_response :success
assert_select 'feed' do
@@ -112,7 +125,9 @@ class ActivitiesControllerTest < Redmine::ControllerTest
end
def test_index_atom_feed_with_explicit_selection
- get :index, :params => {
+ get(
+ :index,
+ :params => {
:format => 'atom',
:with_subprojects => 0,
:show_changesets => 1,
@@ -124,7 +139,7 @@ class ActivitiesControllerTest < Redmine::ControllerTest
:show_time_entries => 1,
:show_wiki_edits => 1
}
-
+ )
assert_response :success
assert_select 'feed' do
@@ -138,22 +153,26 @@ class ActivitiesControllerTest < Redmine::ControllerTest
def test_index_atom_feed_with_one_item_type
with_settings :default_language => 'en' do
- get :index, :params => {
+ get(
+ :index,
+ :params => {
:format => 'atom',
:show_issues => '1'
}
+ )
assert_response :success
-
assert_select 'title', :text => /Issues/
end
end
def test_index_atom_feed_with_user
- get :index, :params => {
+ get(
+ :index,
+ :params => {
:user_id => 2,
:format => 'atom'
}
-
+ )
assert_response :success
assert_select 'title', :text => "Redmine: #{User.find(2).name}"
end
@@ -174,12 +193,14 @@ class ActivitiesControllerTest < Redmine::ControllerTest
def test_index_with_submitted_scope_should_save_as_preference
@request.session[:user_id] = 2
-
- get :index, :params => {
+ get(
+ :index,
+ :params => {
:show_issues => '1',
:show_messages => '1',
:submit => 'Apply'
}
+ )
assert_response :success
assert_equal %w(issues messages), User.find(2).pref.activity_scope.sort
end
@@ -211,10 +232,12 @@ class ActivitiesControllerTest < Redmine::ControllerTest
def test_index_up_to_yesterday_should_show_next_page_link
@request.session[:user_id] = 2
-
- get :index, :params => {
- :from => (User.find(2).today-1)
+ get(
+ :index,
+ :params => {
+ :from => (User.find(2).today - 1)
}
+ )
assert_response :success
assert_select '.pagination a', :text => /Previous/
assert_select '.pagination a', :text => /Next/