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
adapt spec expectations
ulfertsf174a10dcc45
diff --git a/spec/helpers/individual_principal_hooks_helper_spec.rb b/spec/helpers/individual_principal_hooks_helper_spec.rbindex b087c414d80..074bfae738b 100644--- a/spec/helpers/individual_principal_hooks_helper_spec.rb+++ b/spec/helpers/individual_principal_hooks_helper_spec.rb@@ -36,43 +36,48 @@ describe IndividualPrincipalHooksHelper, type: :helper dodescribe '#individual_principal_key' doit 'returns the class name in underscore format' do- expect(helper.individual_principal_key(user)).to eql(:user)- expect(helper.individual_principal_key(placeholder_user)).to eql(:placeholder_user)+ expect(helper.individual_principal_key(user)).to be(:user)+ expect(helper.individual_principal_key(placeholder_user)).to be(:placeholder_user)endenddescribe '#call_individual_principals_memberships_hook' do- context 'with user and without context' do- before do- expect(helper).to receive(:call_hook).with(:view_users_memberships_table_foo,- user: user)- end+ before do+ allow(helper)+ .to receive(:call_hook)+ end+ context 'with user and without context' doit 'call call_hook with the correct arguments' dohelper.call_individual_principals_memberships_hook(user, 'foo')++ expect(helper)+ .to have_received(:call_hook)+ .with(:view_users_memberships_table_foo,+ user: user)endendcontext 'with placeholder user and without context' do- before do- expect(helper).to receive(:call_hook).with(:view_placeholder_users_memberships_table_foo,- placeholder_user: placeholder_user)- end-it 'call call_hook with the correct arguments' dohelper.call_individual_principals_memberships_hook(placeholder_user, 'foo')++ expect(helper)+ .to have_received(:call_hook)+ .with(:view_placeholder_users_memberships_table_foo,+ placeholder_user: placeholder_user)endendcontext 'with user and with context' do- before do- expect(helper).to receive(:call_hook).with(:view_users_memberships_table_foo,- user: user,- yay: 'yo')- end-it 'call call_hook with the correct arguments' dohelper.call_individual_principals_memberships_hook(user, 'foo', yay: 'yo')++ expect(helper)+ .to have_received(:call_hook)+ .with(:view_users_memberships_table_foo,+ user: user,+ yay: 'yo')endendenddiff --git a/spec/lib/open_project/configuration_spec.rb b/spec/lib/open_project/configuration_spec.rbindex 7da8a6c1928..32df4e03933 100644--- a/spec/lib/open_project/configuration_spec.rb+++ b/spec/lib/open_project/configuration_spec.rb@@ -437,7 +437,14 @@ describe OpenProject::Configuration doenddescribe '.configure_legacy_action_mailer' do- let(:action_mailer) { double('ActionMailer::Base', deliveries: []) }+ let(:action_mailer) do+ class_double('ActionMailer::Base',+ deliveries: []).tap do |mailer|+ allow(mailer).to receive(:perform_deliveries=)+ allow(mailer).to receive(:delivery_method=)+ allow(mailer).to receive(:smtp_settings=)+ end+ endlet(:config) do{ 'email_delivery_method' => 'smtp','smtp_address' => 'smtp.example.net',@@ -449,11 +456,18 @@ describe OpenProject::Configuration doendit 'enables deliveries and configure ActionMailer smtp delivery' do- expect(action_mailer).to receive(:perform_deliveries=).with(true)- expect(action_mailer).to receive(:delivery_method=).with(:smtp)- expect(action_mailer).to receive(:smtp_settings=).with(address: 'smtp.example.net',- port: '25')described_class.send(:configure_legacy_action_mailer, config)++ expect(action_mailer)+ .to have_received(:perform_deliveries=)+ .with(true)+ expect(action_mailer)+ .to have_received(:delivery_method=)+ .with(:smtp)+ expect(action_mailer)+ .to have_received(:smtp_settings=)+ .with(address: 'smtp.example.net',+ port: '25')endend