OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Fix indentation from editorconfig
Oliver Güntherdab04415c4cf
diff --git a/.editorconfig b/.editorconfigindex 9e1d4b39aab..7ddfd39bba3 100644--- a/.editorconfig+++ b/.editorconfig@@ -474,7 +474,7 @@ ij_ruby_spaces_around_other_operators = trueij_ruby_spaces_around_range_operators = falseij_ruby_spaces_around_relational_operators = trueij_ruby_spaces_within_array_initializer_braces = true-ij_ruby_spaces_within_braces = false+ij_ruby_spaces_within_braces = true[{version-autocompleter.component.ts,*.ats,*.ts}]ij_continuation_indent_size = 2diff --git a/spec/models/permitted_params_spec.rb b/spec/models/permitted_params_spec.rbindex 214432466b5..9f8e6328301 100644--- a/spec/models/permitted_params_spec.rb+++ b/spec/models/permitted_params_spec.rb@@ -35,17 +35,19 @@ describe PermittedParams, type: :model doshared_context 'prepare params comparison' dolet(:params_key) { defined?(hash_key) ? hash_key : attribute }let(:params) do- nested_params = if defined?(nested_key)- {nested_key => hash}- else- hash- end+ nested_params =+ if defined?(nested_key)+ { nested_key => hash }+ else+ hash+ end- ac_params = if defined?(flat) && flat- nested_params- else- {params_key => nested_params}- end+ ac_params =+ if defined?(flat) && flat+ nested_params+ else+ { params_key => nested_params }+ endActionController::Parameters.new(ac_params)end@@ -81,7 +83,7 @@ describe PermittedParams, type: :model do# taking the originally whitelisted params to be restored lateroriginal_whitelisted = PermittedParams.instance_variable_get(:@whitelisted_params)- params = ActionController::Parameters.new(project_type: {'blubs1' => 'blubs'})+ params = ActionController::Parameters.new(project_type: { 'blubs1' => 'blubs' })PermittedParams.instance_variable_set(:@whitelisted_params, original_whitelisted)end@@ -114,7 +116,7 @@ describe PermittedParams, type: :model doacceptable_params_with_data = HashWithIndifferentAccess[acceptable_params.map { |x| [x, 'value'] }]- acceptable_params_with_data['custom_field_values'] = {'1' => 'foo', '2' => 'bar', '3' => 'baz'}+ acceptable_params_with_data['custom_field_values'] = { '1' => 'foo', '2' => 'bar', '3' => 'baz' }acceptable_params_with_dataend@@ -177,7 +179,7 @@ describe PermittedParams, type: :model dodescribe '#membership' dolet(:attribute) { :membership }let(:hash) do- {'project_id' => '1', 'role_ids' => ['1', '2', '4']}+ { 'project_id' => '1', 'role_ids' => ['1', '2', '4'] }endit_behaves_like 'allows params'@@ -211,7 +213,7 @@ describe PermittedParams, type: :model doendcontext 'custom field values' do- let(:hash) { {'custom_field_values' => {'1' => '5'}} }+ let(:hash) { { 'custom_field_values' => { '1' => '5' } } }it_behaves_like 'allows params'end@@ -242,11 +244,11 @@ describe PermittedParams, type: :model dolet(:instance) { double('message', project: double('project')) }let(:project) { double('project') }let(:allowed_params) do- {'subject' => 'value',- 'content' => 'value',- 'forum_id' => 'value',- 'sticky' => 'true',- 'locked' => 'true'}+ { 'subject' => 'value',+ 'content' => 'value',+ 'forum_id' => 'value',+ 'sticky' => 'true',+ 'locked' => 'true' }endlet(:hash) do@@ -269,8 +271,8 @@ describe PermittedParams, type: :model dolet(:attribute) { :attachments }let(:hash) do- {'file' => 'myfile',- 'description' => 'mydescription'}+ { 'file' => 'myfile',+ 'description' => 'mydescription' }endit_behaves_like 'allows params'@@ -281,7 +283,7 @@ describe PermittedParams, type: :model dolet(:hash_key) { 'project' }let(:hash) do- {'type_ids' => ['1', '', '2']}+ { 'type_ids' => ['1', '', '2'] }endlet(:allowed_params) do@@ -301,8 +303,8 @@ describe PermittedParams, type: :model dolet(:attribute) { :color }let(:hash) do- {'name' => 'blubs',- 'hexcode' => '#fff'}+ { 'name' => 'blubs',+ 'hexcode' => '#fff' }endit_behaves_like 'allows params'@@ -313,7 +315,7 @@ describe PermittedParams, type: :model dolet(:hash_key) { 'color' }let(:hash) do- {'move_to' => '1'}+ { 'move_to' => '1' }endit_behaves_like 'allows params'@@ -323,7 +325,7 @@ describe PermittedParams, type: :model dolet(:attribute) { :custom_field }let(:hash) do- {'editable' => '0', 'visible' => '0'}+ { 'editable' => '0', 'visible' => '0' }endit_behaves_like 'allows params'@@ -335,8 +337,8 @@ describe PermittedParams, type: :model do{'name' => 'blubs','description' => 'blubs blubs',- 'actions' => {'assigned_to' => '1'},- 'conditions' => {'status' => '42'},+ 'actions' => { 'assigned_to' => '1' },+ 'conditions' => { 'status' => '42' },'move_to' => 'lower'}end@@ -349,116 +351,116 @@ describe PermittedParams, type: :model dolet(:hash_key) { 'work_package' }context 'subject' do- let(:hash) { {'subject' => 'blubs'} }+ let(:hash) { { 'subject' => 'blubs' } }it_behaves_like 'allows params'endcontext 'description' do- let(:hash) { {'description' => 'blubs'} }+ let(:hash) { { 'description' => 'blubs' } }it_behaves_like 'allows params'endcontext 'start_date' do- let(:hash) { {'start_date' => '2013-07-08'} }+ let(:hash) { { 'start_date' => '2013-07-08' } }it_behaves_like 'allows params'endcontext 'due_date' do- let(:hash) { {'due_date' => '2013-07-08'} }+ let(:hash) { { 'due_date' => '2013-07-08' } }it_behaves_like 'allows params'endcontext 'assigned_to_id' do- let(:hash) { {'assigned_to_id' => '1'} }+ let(:hash) { { 'assigned_to_id' => '1' } }it_behaves_like 'allows params'endcontext 'responsible_id' do- let(:hash) { {'responsible_id' => '1'} }+ let(:hash) { { 'responsible_id' => '1' } }it_behaves_like 'allows params'endcontext 'type_id' do- let(:hash) { {'type_id' => '1'} }+ let(:hash) { { 'type_id' => '1' } }it_behaves_like 'allows params'endcontext 'priority_id' do- let(:hash) { {'priority_id' => '1'} }+ let(:hash) { { 'priority_id' => '1' } }it_behaves_like 'allows params'endcontext 'parent_id' do- let(:hash) { {'parent_id' => '1'} }+ let(:hash) { { 'parent_id' => '1' } }it_behaves_like 'allows params'endcontext 'parent_id' do- let(:hash) { {'parent_id' => '1'} }+ let(:hash) { { 'parent_id' => '1' } }it_behaves_like 'allows params'endcontext 'version_id' do- let(:hash) { {'version_id' => '1'} }+ let(:hash) { { 'version_id' => '1' } }it_behaves_like 'allows params'endcontext 'estimated_hours' do- let(:hash) { {'estimated_hours' => '1'} }+ let(:hash) { { 'estimated_hours' => '1' } }it_behaves_like 'allows params'endcontext 'done_ratio' do- let(:hash) { {'done_ratio' => '1'} }+ let(:hash) { { 'done_ratio' => '1' } }it_behaves_like 'allows params'endcontext 'lock_version' do- let(:hash) { {'lock_version' => '1'} }+ let(:hash) { { 'lock_version' => '1' } }it_behaves_like 'allows params'endcontext 'status_id' do- let(:hash) { {'status_id' => '1'} }+ let(:hash) { { 'status_id' => '1' } }it_behaves_like 'allows params'endcontext 'category_id' do- let(:hash) { {'category_id' => '1'} }+ let(:hash) { { 'category_id' => '1' } }it_behaves_like 'allows params'endcontext 'notes' do- let(:hash) { {'journal_notes' => 'blubs'} }+ let(:hash) { { 'journal_notes' => 'blubs' } }it_behaves_like 'allows params'endcontext 'attachments' do- let(:hash) { {'attachments' => [{'file' => 'djskfj', 'description' => 'desc'}]} }+ let(:hash) { { 'attachments' => [{ 'file' => 'djskfj', 'description' => 'desc' }] } }it_behaves_like 'allows params'endcontext 'watcher_user_ids' doinclude_context 'prepare params comparison'- let(:hash) { {'watcher_user_ids' => ['1', '2']} }+ let(:hash) { { 'watcher_user_ids' => ['1', '2'] } }let(:project) { double('project') }before do@@ -487,7 +489,7 @@ describe PermittedParams, type: :model docontext 'time_entry' doinclude_context 'prepare params comparison'- let(:hash) { {'time_entry' => {'hours' => '5', 'activity_id' => '1', 'comments' => 'lorem'}} }+ let(:hash) { { 'time_entry' => { 'hours' => '5', 'activity_id' => '1', 'comments' => 'lorem' } } }let(:project) { double('project') }before do@@ -514,13 +516,13 @@ describe PermittedParams, type: :model doendcontext 'custom field values' do- let(:hash) { {'custom_field_values' => {'1' => '5'}} }+ let(:hash) { { 'custom_field_values' => { '1' => '5' } } }it_behaves_like 'allows params'endcontext "removes custom field values that do not follow the schema 'id as string' => 'value as string'" do- let(:hash) { {'custom_field_values' => {'blubs' => '5', '5' => {'1' => '2'}}} }+ let(:hash) { { 'custom_field_values' => { 'blubs' => '5', '5' => { '1' => '2' } } } }it_behaves_like 'forbids params'end@@ -530,12 +532,12 @@ describe PermittedParams, type: :model dolet(:attribute) { :time_entry_activities_project }let(:hash) do[- {"activity_id" => "5", "active" => "0"},- {"activity_id" => "6", "active" => "1"}+ { "activity_id" => "5", "active" => "0" },+ { "activity_id" => "6", "active" => "1" }]endlet(:allowed_params) do- [{"activity_id" => "5", "active" => "0"}, {"activity_id" => "6", "active" => "1"}]+ [{ "activity_id" => "5", "active" => "0" }, { "activity_id" => "6", "active" => "1" }]endit_behaves_like 'allows params' do@@ -579,7 +581,7 @@ describe PermittedParams, type: :model doadmin_permissions.each do |field|context field do- let(:hash) { {field => 'test'} }+ let(:hash) { { field => 'test' } }it "permits #{field}" doexpect(subject).to eq(field => 'test')@@ -588,7 +590,7 @@ describe PermittedParams, type: :model doendcontext 'with no password change allowed' do- let(:hash) { {'force_password_change' => 'true'} }+ let(:hash) { { 'force_password_change' => 'true' } }let(:change_password_allowed) { false }it 'does not permit force_password_change' do@@ -597,7 +599,7 @@ describe PermittedParams, type: :model doendcontext 'with external authentication' do- let(:hash) { {'auth_source_id' => 'true'} }+ let(:hash) { { 'auth_source_id' => 'true' } }let(:external_authentication) { true }it 'does not permit auth_source_id' do@@ -606,7 +608,7 @@ describe PermittedParams, type: :model doendcontext 'custom field values' do- let(:hash) { {'custom_field_values' => {'1' => '5'}} }+ let(:hash) { { 'custom_field_values' => { '1' => '5' } } }it 'permits custom_field_values' doexpect(subject).to eq(hash)@@ -614,7 +616,7 @@ describe PermittedParams, type: :model doendcontext "custom field values that do not follow the schema 'id as string' => 'value as string'" do- let(:hash) { {'custom_field_values' => {'blubs' => '5', '5' => {'1' => '2'}}} }+ let(:hash) { { 'custom_field_values' => { 'blubs' => '5', '5' => { '1' => '2' } } } }it 'are removed' doexpect(subject).to eq({})@@ -638,7 +640,7 @@ describe PermittedParams, type: :model douser_permissions.each do |field|context field do- let(:hash) { {field => 'test'} }+ let(:hash) { { field => 'test' } }it_behaves_like 'allows params'end@@ -646,26 +648,26 @@ describe PermittedParams, type: :model do(admin_permissions - user_permissions).each do |field|context "#{field} (admin-only)" do- let(:hash) { {field => 'test'} }+ let(:hash) { { field => 'test' } }it_behaves_like 'forbids params'endendcontext 'custom field values' do- let(:hash) { {'custom_field_values' => {'1' => '5'}} }+ let(:hash) { { 'custom_field_values' => { '1' => '5' } } }it_behaves_like 'allows params'endcontext "custom field values that do not follow the schema 'id as string' => 'value as string'" do- let(:hash) { {'custom_field_values' => {'blubs' => '5', '5' => {'1' => '2'}}} }+ let(:hash) { { 'custom_field_values' => { 'blubs' => '5', '5' => { '1' => '2' } } } }it_behaves_like 'forbids params'endcontext 'identity_url' do- let(:hash) { {'identity_url' => 'test_identity_url'} }+ let(:hash) { { 'identity_url' => 'test_identity_url' } }it_behaves_like 'forbids params'end@@ -679,39 +681,39 @@ describe PermittedParams, type: :model douser_permissions = %w(login firstname lastname mail language)user_permissions.each do |field|- let(:hash) { {field => 'test'} }+ let(:hash) { { field => 'test' } }it_behaves_like 'allows params'endcontext 'identity_url' do- let(:hash) { {'identity_url' => 'test_identity_url'} }+ let(:hash) { { 'identity_url' => 'test_identity_url' } }it_behaves_like 'forbids params'endendshared_examples_for 'allows enumeration move params' do- let(:hash) { {'2' => {'move_to' => 'lower'}} }+ let(:hash) { { '2' => { 'move_to' => 'lower' } } }it_behaves_like 'allows params'endshared_examples_for 'allows move params' do- let(:hash) { {'move_to' => 'lower'} }+ let(:hash) { { 'move_to' => 'lower' } }it_behaves_like 'allows params'endshared_examples_for 'allows custom fields' dodescribe 'valid custom fields' do- let(:hash) { {'1' => {'custom_field_values' => {'1' => '5'}}} }+ let(:hash) { { '1' => { 'custom_field_values' => { '1' => '5' } } } }it_behaves_like 'allows params'enddescribe 'invalid custom fields' do- let(:hash) { {'custom_field_values' => {'blubs' => '5', '5' => {'1' => '2'}}} }+ let(:hash) { { 'custom_field_values' => { 'blubs' => '5', '5' => { '1' => '2' } } } }it_behaves_like 'forbids params'end@@ -721,25 +723,25 @@ describe PermittedParams, type: :model dolet (:attribute) { :status }describe 'name' do- let(:hash) { {'name' => 'blubs'} }+ let(:hash) { { 'name' => 'blubs' } }it_behaves_like 'allows params'enddescribe 'default_done_ratio' do- let(:hash) { {'default_done_ratio' => '10'} }+ let(:hash) { { 'default_done_ratio' => '10' } }it_behaves_like 'allows params'enddescribe 'is_closed' do- let(:hash) { {'is_closed' => 'true'} }+ let(:hash) { { 'is_closed' => 'true' } }it_behaves_like 'allows params'enddescribe 'is_default' do- let(:hash) { {'is_default' => 'true'} }+ let(:hash) { { 'is_default' => 'true' } }it_behaves_like 'allows params'end@@ -765,7 +767,7 @@ describe PermittedParams, type: :model do'brute_force_block_after_failed_logins' => 'value','password_active_rules' => ['value'],'default_projects_modules' => ['value', 'value'],- 'emails_footer' => {'en' => 'value'}+ 'emails_footer' => { 'en' => 'value' }}end@@ -787,7 +789,7 @@ describe PermittedParams, type: :model do'brute_force_block_after_failed_logins' => 'value','password_active_rules' => ['value'],'default_projects_modules' => ['value', 'value'],- 'emails_footer' => {'en' => 'value'}+ 'emails_footer' => { 'en' => 'value' }}end@@ -796,7 +798,7 @@ describe PermittedParams, type: :model do'sendmail_arguments' => 'value','brute_force_block_after_failed_logins' => 'value','default_projects_modules' => ['value', 'value'],- 'emails_footer' => {'en' => 'value'}+ 'emails_footer' => { 'en' => 'value' }}end@@ -850,25 +852,25 @@ describe PermittedParams, type: :model dolet (:attribute) { :enumerations }describe 'name' do- let(:hash) { {'1' => {'name' => 'blubs'}} }+ let(:hash) { { '1' => { 'name' => 'blubs' } } }it_behaves_like 'allows params'enddescribe 'active' do- let(:hash) { {'1' => {'active' => 'true'}} }+ let(:hash) { { '1' => { 'active' => 'true' } } }it_behaves_like 'allows params'enddescribe 'is_default' do- let(:hash) { {'1' => {'is_default' => 'true'}} }+ let(:hash) { { '1' => { 'is_default' => 'true' } } }it_behaves_like 'allows params'enddescribe 'reassign_to_id' do- let(:hash) { {'1' => {'reassign_to_id' => '1'}} }+ let(:hash) { { '1' => { 'reassign_to_id' => '1' } } }it_behaves_like 'allows params'end@@ -887,13 +889,13 @@ describe PermittedParams, type: :model dolet (:attribute) { :wiki_page_rename }describe 'title' do- let(:hash) { {'title' => 'blubs'} }+ let(:hash) { { 'title' => 'blubs' } }it_behaves_like 'allows params'enddescribe 'redirect_existing_links' do- let(:hash) { {'redirect_existing_links' => '1'} }+ let(:hash) { { 'redirect_existing_links' => '1' } }it_behaves_like 'allows params'end@@ -905,19 +907,19 @@ describe PermittedParams, type: :model dolet (:attribute) { :wiki_page }describe 'title' do- let(:hash) { {'title' => 'blubs'} }+ let(:hash) { { 'title' => 'blubs' } }it_behaves_like 'allows nested params'enddescribe 'parent_id' do- let(:hash) { {'parent_id' => '1'} }+ let(:hash) { { 'parent_id' => '1' } }it_behaves_like 'allows nested params'enddescribe 'redirect_existing_links' do- let(:hash) { {'redirect_existing_links' => '1'} }+ let(:hash) { { 'redirect_existing_links' => '1' } }it_behaves_like 'allows nested params'end@@ -928,19 +930,19 @@ describe PermittedParams, type: :model dolet (:attribute) { :wiki_content }describe 'title' do- let(:hash) { {'comments' => 'blubs'} }+ let(:hash) { { 'comments' => 'blubs' } }it_behaves_like 'allows params'enddescribe 'text' do- let(:hash) { {'text' => 'blubs'} }+ let(:hash) { { 'text' => 'blubs' } }it_behaves_like 'allows params'enddescribe 'lock_version' do- let(:hash) { {'lock_version' => '1'} }+ let(:hash) { { 'lock_version' => '1' } }it_behaves_like 'allows params'end@@ -950,31 +952,31 @@ describe PermittedParams, type: :model dolet (:attribute) { :member }describe 'role_ids' do- let(:hash) { {'role_ids' => []} }+ let(:hash) { { 'role_ids' => [] } }it_behaves_like 'allows params'enddescribe 'user_id' do- let(:hash) { {'user_id' => 'blubs'} }+ let(:hash) { { 'user_id' => 'blubs' } }it_behaves_like 'forbids params'enddescribe 'project_id' do- let(:hash) { {'user_id' => 'blubs'} }+ let(:hash) { { 'user_id' => 'blubs' } }it_behaves_like 'forbids params'enddescribe 'created_on' do- let(:hash) { {'created_on' => 'blubs'} }+ let(:hash) { { 'created_on' => 'blubs' } }it_behaves_like 'forbids params'enddescribe 'mail_notification' do- let(:hash) { {'mail_notification' => 'blubs'} }+ let(:hash) { { 'mail_notification' => 'blubs' } }it_behaves_like 'forbids params'end@@ -1002,13 +1004,13 @@ describe PermittedParams, type: :model doendcontext 'with an allowed parameter' do- let(:hash) { {'a_test_field' => 'a test value'} }+ let(:hash) { { 'a_test_field' => 'a test value' } }it_behaves_like 'allows params'endcontext 'with a disallowed parameter' do- let(:hash) { {'a_not_allowed_field' => 'a test value'} }+ let(:hash) { { 'a_not_allowed_field' => 'a test value' } }it_behaves_like 'forbids params'end@@ -1016,7 +1018,7 @@ describe PermittedParams, type: :model dodescribe 'with an unknown key' dolet(:attribute) { :unknown_key }- let(:hash) { {'a_test_field' => 'a test value'} }+ let(:hash) { { 'a_test_field' => 'a test value' } }before doexpect(Rails.logger).not_to receive(:warn)diff --git a/spec/models/queries/work_packages/filter/assigned_to_filter_spec.rb b/spec/models/queries/work_packages/filter/assigned_to_filter_spec.rbindex 1b5cc257ff3..b432e1ece53 100644--- a/spec/models/queries/work_packages/filter/assigned_to_filter_spec.rb+++ b/spec/models/queries/work_packages/filter/assigned_to_filter_spec.rb@@ -61,7 +61,7 @@ describe Queries::WorkPackages::Filter::AssignedToFilter, type: :model dobefore doallow(User).to receive(:current)- .and_return(assignee)+ .and_return(assignee)endit 'returns the work package' do@@ -84,7 +84,7 @@ describe Queries::WorkPackages::Filter::AssignedToFilter, type: :model dobefore doallow(User).to receive(:current)- .and_return(FactoryBot.create(:user))+ .and_return(FactoryBot.create(:user))endit 'does not return the work package' do@@ -106,7 +106,7 @@ describe Queries::WorkPackages::Filter::AssignedToFilter, type: :model doallow(User).to receive(:current)- .and_return(user)+ .and_return(user)endit 'returns the mapped value' do@@ -191,10 +191,10 @@ describe Queries::WorkPackages::Filter::AssignedToFilter, type: :model doloader = double('principal_loader')allow(loader).to receive(:user_values)- .and_return(user_values)+ .and_return(user_values)allow(loader).to receive(:group_values)- .and_return(group_values)+ .and_return(group_values)loaderend@@ -218,8 +218,8 @@ describe Queries::WorkPackages::Filter::AssignedToFilter, type: :model dobefore doallow(Queries::WorkPackages::Filter::PrincipalLoader).to receive(:new)- .with(project)- .and_return(principal_loader)+ .with(project)+ .and_return(principal_loader)enddescribe '#available?' do@@ -228,7 +228,7 @@ describe Queries::WorkPackages::Filter::AssignedToFilter, type: :model dobefore doallow(User).to receive_message_chain(:current, :logged?)- .and_return(logged_in)+ .and_return(logged_in)endcontext 'when being logged in' do@@ -239,7 +239,7 @@ describe Queries::WorkPackages::Filter::AssignedToFilter, type: :model doit 'is true if there is another user selectable' doallow(principal_loader).to receive(:user_values)- .and_return([user_1])+ .and_return([user_1])expect(instance).to be_availableend@@ -247,7 +247,7 @@ describe Queries::WorkPackages::Filter::AssignedToFilter, type: :model doit 'is true if there is another group selectable' doallow(principal_loader).to receive(:group_values)- .and_return([[group_1.name, group_1.id.to_s]])+ .and_return([[group_1.name, group_1.id.to_s]])expect(instance).to be_availableend@@ -263,7 +263,7 @@ describe Queries::WorkPackages::Filter::AssignedToFilter, type: :model doit 'is true if there is another user selectable' doallow(principal_loader).to receive(:user_values)- .and_return([[user_1.name, user_1.id.to_s]])+ .and_return([[user_1.name, user_1.id.to_s]])expect(instance).to be_availableend@@ -271,7 +271,7 @@ describe Queries::WorkPackages::Filter::AssignedToFilter, type: :model doit 'is true if there is another group selectable' doallow(principal_loader).to receive(:group_values)- .and_return([[group_1.name, group_1.id.to_s]])+ .and_return([[group_1.name, group_1.id.to_s]])expect(instance).to be_availableend@@ -279,11 +279,11 @@ describe Queries::WorkPackages::Filter::AssignedToFilter, type: :model doit 'is false if there is another group selectable but the setting is not favourable' doallow(Setting).to receive(:work_package_group_assignment?)- .and_return(false)+ .and_return(false)allow(principal_loader).to receive(:group_values)- .and_return([[group_1.name, group_1.id.to_s]])+ .and_return([[group_1.name, group_1.id.to_s]])expect(instance).to_not be_availableend@@ -296,15 +296,15 @@ describe Queries::WorkPackages::Filter::AssignedToFilter, type: :model dobefore doallow(User).to receive_message_chain(:current, :logged?)- .and_return(logged_in)+ .and_return(logged_in)allow(principal_loader).to receive(:user_values)- .and_return([[user_1.name, user_1.id.to_s]])+ .and_return([[user_1.name, user_1.id.to_s]])allow(principal_loader).to receive(:group_values)- .and_return([[group_1.name, group_1.id.to_s]])+ .and_return([[group_1.name, group_1.id.to_s]])endcontext 'when being logged in' do@@ -318,7 +318,7 @@ describe Queries::WorkPackages::Filter::AssignedToFilter, type: :model doit 'returns the me value and only the available users if no group assignmit is allowed' doallow(Setting).to receive(:work_package_group_assignment?)- .and_return(false)+ .and_return(false)expect(instance.allowed_values).to match_array([[I18n.t(:label_me), 'me'],@@ -338,7 +338,7 @@ describe Queries::WorkPackages::Filter::AssignedToFilter, type: :model doit 'returns the available users if no group assignmit is allowed' doallow(Setting).to receive(:work_package_group_assignment?)- .and_return(false)+ .and_return(false)expect(instance.allowed_values).to match_array([[user_1.name, user_1.id.to_s]])diff --git a/spec_legacy/functional/users_controller_spec.rb b/spec_legacy/functional/users_controller_spec.rbindex e78e2953c18..a4f7bda6731 100644--- a/spec_legacy/functional/users_controller_spec.rb+++ b/spec_legacy/functional/users_controller_spec.rb@@ -55,7 +55,7 @@ describe UsersController, type: :controller doendit 'should index with name filter' do- get :index, params: {name: 'john'}+ get :index, params: { name: 'john' }assert_response :successassert_template 'index'users = assigns(:users)@@ -65,7 +65,7 @@ describe UsersController, type: :controller doendit 'should index with group filter' do- get :index, params: {group_id: '10'}+ get :index, params: { group_id: '10' }assert_response :successassert_template 'index'users = assigns(:users)@@ -80,32 +80,32 @@ describe UsersController, type: :controller docustom_field = CustomField.create!(name: 'Testing', field_format: 'text')user.custom_values.build(custom_field: custom_field).save!- get :show, params: {id: 2}+ get :show, params: { id: 2 }assert_response :successendit 'should show inactive' dosession[:user_id] = nil- get :show, params: {id: 5}+ get :show, params: { id: 5 }assert_response 404endit 'should show should not reveal users with no visible activity or project' dosession[:user_id] = nil- get :show, params: {id: 9}+ get :show, params: { id: 9 }assert_response 404endit 'should show inactive by admin' dosession[:user_id] = 1- get :show, params: {id: 5}+ get :show, params: { id: 5 }assert_response 200refute_nil assigns(:user)endit 'should show displays memberships based on project visibility' dosession[:user_id] = 1- get :show, params: {id: 2}+ get :show, params: { id: 2 }assert_response :successmemberships = assigns(:memberships)refute_nil memberships@@ -115,13 +115,13 @@ describe UsersController, type: :controller doit 'should show current should require authentication' dosession[:user_id] = nil- get :show, params: {id: 'current'}+ get :show, params: { id: 'current' }assert_response 302endit 'should show current' dosession[:user_id] = 2- get :show, params: {id: 'current'}+ get :show, params: { id: 'current' }assert_response :successassert_template 'show'assert_equal User.find(2), assigns(:user)@@ -183,7 +183,7 @@ describe UsersController, type: :controller do# Provide at least one user field, otherwise strong_parameters regards the user parameter# as non-existent and raises ActionController::ParameterMissing, which in turn# results in a 400.- post :create, params: {user: {login: 'jdoe'}}+ post :create, params: { user: { login: 'jdoe' } }endassert_response :success@@ -191,7 +191,7 @@ describe UsersController, type: :controller doendit 'should edit' do- get :edit, params: {id: 2}+ get :edit, params: { id: 2 }assert_response :successassert_template 'edit'@@ -200,7 +200,7 @@ describe UsersController, type: :controller doit 'should update with failure' doassert_no_difference 'User.count' do- put :update, params: {id: 2, user: {firstname: ''}}+ put :update, params: { id: 2, user: { firstname: '' } }endassert_response :success@@ -210,10 +210,10 @@ describe UsersController, type: :controller doit 'should update with password change should send a notification' doSetting.bcc_recipients = '1'- put :update, params: {id: 2,- user: {password: 'newpassPASS!',- password_confirmation: 'newpassPASS!'},- send_information: '1'}+ put :update, params: { id: 2,+ user: { password: 'newpassPASS!',+ password_confirmation: 'newpassPASS!' },+ send_information: '1' }u = User.find(2)assert u.check_password?('newpassPASS!')