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

Lint: Address Rubocop warnings in `spec/models/principal_spec.rb`

Aaron Contrerasff28d37d4b81
diff --git a/spec/models/principal_spec.rb b/spec/models/principal_spec.rb
index f621ddca746..f202d36dae3 100644
--- a/spec/models/principal_spec.rb
+++ b/spec/models/principal_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2023 the OpenProject GmbH
@@ -32,23 +34,23 @@ RSpec.describe Principal do
let(:user) { build(:user) }
let(:group) { build(:group) }
- def self.should_return_groups_and_users_if_active(method, *params)
+ def self.should_return_groups_and_users_if_active(method, *)
it 'returns a user' do
user.save!
- expect(Principal.send(method, *params).where(id: user.id)).to eq([user])
+ expect(described_class.send(method, *).where(id: user.id)).to eq([user])
end
it 'returns a group' do
group.save!
- expect(Principal.send(method, *params).where(id: group.id)).to eq([group])
+ expect(described_class.send(method, *).where(id: group.id)).to eq([group])
end
it 'does not return the anonymous user' do
User.anonymous
- expect(Principal.send(method, *params).where(id: user.id)).to eq([])
+ expect(described_class.send(method, *).where(id: user.id)).to eq([])
end
it 'does not return an inactive user' do
@@ -56,7 +58,7 @@ RSpec.describe Principal do
user.save!
- expect(Principal.send(method, *params).where(id: user.id).to_a).to eq([])
+ expect(described_class.send(method, *).where(id: user.id).to_a).to eq([])
end
end
@@ -74,7 +76,7 @@ RSpec.describe Principal do
user.save!
- expect(Principal.active.where(id: user.id)).to eq([])
+ expect(described_class.active.where(id: user.id)).to eq([])
end
end
@@ -86,7 +88,7 @@ RSpec.describe Principal do
user.save!
- expect(Principal.not_locked.where(id: user.id)).to eq([user])
+ expect(described_class.not_locked.where(id: user.id)).to eq([user])
end
end
end