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

Add a test that excludes not-started tokens

Klaus Zanders77df08765606
diff --git a/spec/models/enterprise_token_spec.rb b/spec/models/enterprise_token_spec.rb
index de398ce5226..5a11e2acdbb 100644
--- a/spec/models/enterprise_token_spec.rb
+++ b/spec/models/enterprise_token_spec.rb
@@ -309,6 +309,14 @@ RSpec.describe EnterpriseToken do
end
end
+ context "with a token that has not started yet" do
+ let!(:future_token) { create_enterprise_token("a_future_token", starts_at: 1.month.from_now) }
+
+ it "does not return the future token" do
+ expect(described_class.active_tokens).to be_empty
+ end
+ end
+
context "with an active token" do
let!(:active_token) { create_enterprise_token("an_active_token", expires_at: 1.year.from_now) }