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

Ensure mock tokens have a starts_at date

Klaus Zanders401f43669bb4
diff --git a/app/models/enterprise_token.rb b/app/models/enterprise_token.rb
index 49978f30c96..f32b508d742 100644
--- a/app/models/enterprise_token.rb
+++ b/app/models/enterprise_token.rb
@@ -151,7 +151,9 @@ class EnterpriseToken < ApplicationRecord
:plan,
:features,
:version,
+ :started?,
:trial?,
+ :active?,
to: :token_object
def token_object
diff --git a/spec/support/enterprise_token_factory.rb b/spec/support/enterprise_token_factory.rb
index 0e2a81670dd..08b9e360ba1 100644
--- a/spec/support/enterprise_token_factory.rb
+++ b/spec/support/enterprise_token_factory.rb
@@ -88,6 +88,7 @@ module EnterpriseTokenFactory
def mock_token_object(encoded_token_name, **attributes)
token = OpenProject::Token.new(domain: Setting.host_name,
+ starts_at: Date.yesterday,
expires_at: 1.year.from_now,
**attributes)
allow(OpenProject::Token)