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

Fix trial spec

Oliver Güntherc0fbb745b6a6
diff --git a/app/services/enterprise_trials/augur_load_trial_service.rb b/app/services/enterprise_trials/augur_load_trial_service.rb
index f866c03fc21..2b090d9121d 100644
--- a/app/services/enterprise_trials/augur_load_trial_service.rb
+++ b/app/services/enterprise_trials/augur_load_trial_service.rb
@@ -40,7 +40,7 @@ module EnterpriseTrials
def call
handle_response(
OpenProject.httpx.get(
- URI.join(augur_host, "/public/v1/trials/", @trial_key.value)
+ URI.join(augur_host, "/public/v1/trials/#{@trial_key.value}")
)
)
end
diff --git a/app/services/enterprise_trials/augur_resend_confirmation_service.rb b/app/services/enterprise_trials/augur_resend_confirmation_service.rb
index 66526b77783..e2e3a16485c 100644
--- a/app/services/enterprise_trials/augur_resend_confirmation_service.rb
+++ b/app/services/enterprise_trials/augur_resend_confirmation_service.rb
@@ -37,7 +37,7 @@ module EnterpriseTrials
def call
handle_response(
OpenProject.httpx.post(
- URI.join(augur_host, "/public/v1/trials/", @trial_key.value, "/resend")
+ URI.join(augur_host, "/public/v1/trials/#{@trial_key.value}/resend")
)
)
end
@@ -46,7 +46,7 @@ module EnterpriseTrials
def handle_response(response)
case response
- in { status: 202 }
+ in { status: 200 | 202 }
ServiceResult.success(result: nil)
in { status: 404 }
ServiceResult.failure(message: I18n.t("ee.trial.not_found"))
diff --git a/spec/features/admin/enterprise/enterprise_trial_spec.rb b/spec/features/admin/enterprise/enterprise_trial_spec.rb
index 12db9dab510..a25174546a8 100644
--- a/spec/features/admin/enterprise/enterprise_trial_spec.rb
+++ b/spec/features/admin/enterprise/enterprise_trial_spec.rb
@@ -176,7 +176,10 @@ RSpec.describe "Enterprise trial management",
fill_in "Last name", with: "Bar"
fill_in "Email", with: mail
- find_by_id("enterprise_trial_general_consent").check
+ retry_block do
+ check "enterprise_trial_general_consent", allow_label_click: true
+ expect(page).to have_checked_field("enterprise_trial_general_consent")
+ end
end
it "does not send a request when an internal validation fails" do
@@ -273,7 +276,7 @@ RSpec.describe "Enterprise trial management",
# Stub the proxy to a successful return
# which marks the user has confirmed the mail link
stub_request(:get, "https://start.openproject-edge.com:443/public/v1/trials/#{trial_id}")
- .to_return(status: 202, headers: { "Content-Type" => "application/json" }, body: confirmed_body.to_json)
+ .to_return(status: 200, headers: { "Content-Type" => "application/json" }, body: confirmed_body.to_json)
# Expect flash with resend link
page.within("#primerized-flash-messages") do