mirror of
https://github.com/redmine/redmine.git
synced 2026-03-06 12:31:40 +01:00
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
This commit is contained in:
@@ -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/
|
||||
|
||||
Reference in New Issue
Block a user