Skip to content

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

increase specificity of spec

ulfertsaee95c853e7f
diff --git a/spec/models/project_role_spec.rb b/spec/models/project_role_spec.rb
index 561ff22346d..706854f9d35 100644
--- a/spec/models/project_role_spec.rb
+++ b/spec/models/project_role_spec.rb
@@ -37,7 +37,7 @@ RSpec.describe ProjectRole do
let!(:project_role) { create(:project_role) }
let!(:builtin_role) { create(:non_member) }
- it { expect(described_class.givable).to match_array project_role }
+ it { expect(described_class.givable).to contain_exactly project_role }
end
describe '.in_new_project' do
@@ -106,7 +106,7 @@ RSpec.describe ProjectRole do
end
it 'creates a new anonymous role' do
- expect { subject }.to change(described_class, :count)
+ expect { subject }.to change(described_class, :count).by(1)
end
end
end
@@ -124,13 +124,13 @@ RSpec.describe ProjectRole do
.to be_builtin
end
- context 'with a missing anonymous role' do
+ context 'with a missing non_member role' do
before do
described_class.where(builtin: Role::BUILTIN_NON_MEMBER).delete_all
end
- it 'creates a new anonymous role' do
- expect { subject }.to change(described_class, :count)
+ it 'creates a new non_member role' do
+ expect { subject }.to change(described_class, :count).by(1)
end
end
end