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
Cleanup specs for UserAllowedService
Klaus Zanders3aab4ea5b634
diff --git a/spec/services/authorization/user_allowed_service_spec.rb b/spec/services/authorization/user_allowed_service_spec.rbindex cc7e745fef1..27246eae5fb 100644--- a/spec/services/authorization/user_allowed_service_spec.rb+++ b/spec/services/authorization/user_allowed_service_spec.rb@@ -62,21 +62,11 @@ RSpec.describe Authorization::UserAllowedService doArray(context).each do |project|project.active = true- allow(project)- .to receive(:allows_to?)- .with(action)- .and_return(project_allows_to)-- allow(Authorization)- .to receive(:roles)- .with(user, project)- .and_return(user_roles_in_project)+ allow(project).to receive(:allows_to?).with(action).and_return(project_allows_to)+ allow(Authorization).to receive(:roles).with(user, project).and_return(user_roles_in_project)end- allow(role)- .to receive(:allowed_to?)- .with(action)- .and_return(role_grants_action)+ allow(role).to receive(:allowed_to?).with(action).and_return(role_grants_action)endcontext 'with the user having a granting role' do@@ -86,10 +76,7 @@ RSpec.describe Authorization::UserAllowedService doit 'does not call the db twice for a project' doArray(context).each do |project|- allow(Authorization)- .to receive(:roles)- .with(user, project)- .and_return(user_roles_in_project)+ allow(Authorization).to receive(:roles).with(user, project).and_return(user_roles_in_project)endsubject@@ -277,15 +264,8 @@ RSpec.describe Authorization::UserAllowedService docontext 'with the user having a granting role' dobefore do- allow(Authorization)- .to receive(:roles)- .with(user, nil)- .and_return(user_roles_in_project)-- allow(role)- .to receive(:allowed_to?)- .with(action)- .and_return(true)+ allow(Authorization).to receive(:roles).with(user, nil).and_return(user_roles_in_project)+ allow(role).to receive(:allowed_to?).with(action).and_return(true)endcontext 'but the user not being active' do@@ -305,15 +285,8 @@ RSpec.describe Authorization::UserAllowedService docontext 'with the user not having a granting role' dobefore do- allow(Authorization)- .to receive(:roles)- .with(user, nil)- .and_return(user_roles_in_project)-- allow(role)- .to receive(:allowed_to?)- .with(action)- .and_return(false)+ allow(Authorization).to receive(:roles).with(user, nil).and_return(user_roles_in_project)+ allow(role).to receive(:allowed_to?).with(action).and_return(false)endit 'is false' do