From 4ea519fd112afa130556caf2887d7ff28ec63bb5 Mon Sep 17 00:00:00 2001 From: Marko Saric <34340819+metmarkosaric@users.noreply.github.com> Date: Mon, 6 Feb 2023 19:33:45 +0100 Subject: [PATCH] Some changes to the "site taken" copy (#2647) * Some changes to the "site taken" copy * Update site.ex * Fix tests --------- Co-authored-by: Vinicius Brasil --- lib/plausible/site.ex | 2 +- lib/plausible/sites.ex | 2 +- .../controllers/api/external_sites_controller_test.exs | 2 +- test/plausible_web/controllers/site_controller_test.exs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/plausible/site.ex b/lib/plausible/site.ex index bbe8c90b8..8c2859dd7 100644 --- a/lib/plausible/site.ex +++ b/lib/plausible/site.ex @@ -50,7 +50,7 @@ defmodule Plausible.Site do |> validate_domain_reserved_characters() |> unique_constraint(:domain, message: - "This domain has already been taken. Perhaps one of your team members registered it? If that's not the case, please contact support@plausible.io" + "This domain cannot be registered. Perhaps one of your colleagues registered it? Or did you recently delete it from your account? The deletion may take up to 48 hours before you can add the same site again. If that's not the case, please contact support@plausible.io" ) end diff --git a/lib/plausible/sites.ex b/lib/plausible/sites.ex index a77acb636..67fabbd72 100644 --- a/lib/plausible/sites.ex +++ b/lib/plausible/sites.ex @@ -192,7 +192,7 @@ defmodule Plausible.Sites do [ domain: - "This domain has already been taken. Perhaps one of your team members registered it? If that's not the case, please contact support@plausible.io" + "This domain cannot be registered. Perhaps one of your colleagues registered it? Or did you recently delete it from your account? The deletion may take up to 48 hours before you can add the same site again. If that's not the case, please contact support@plausible.io" ] else [] diff --git a/test/plausible_web/controllers/api/external_sites_controller_test.exs b/test/plausible_web/controllers/api/external_sites_controller_test.exs index 01ba959e5..8fb28022d 100644 --- a/test/plausible_web/controllers/api/external_sites_controller_test.exs +++ b/test/plausible_web/controllers/api/external_sites_controller_test.exs @@ -98,7 +98,7 @@ defmodule PlausibleWeb.Api.ExternalSitesControllerTest do assert json_response(conn, 400) == %{ "error" => - "domain: This domain has already been taken. Perhaps one of your team members registered it? If that's not the case, please contact support@plausible.io" + "domain: This domain cannot be registered. Perhaps one of your colleagues registered it? Or did you recently delete it from your account? The deletion may take up to 48 hours before you can add the same site again. If that's not the case, please contact support@plausible.io" } end diff --git a/test/plausible_web/controllers/site_controller_test.exs b/test/plausible_web/controllers/site_controller_test.exs index 8a27f5096..11f3d0f53 100644 --- a/test/plausible_web/controllers/site_controller_test.exs +++ b/test/plausible_web/controllers/site_controller_test.exs @@ -126,7 +126,7 @@ defmodule PlausibleWeb.SiteControllerTest do }) assert html = html_response(conn, 200) - assert html =~ "This domain has already been taken." + assert html =~ "This domain cannot be registered" assert html =~ "please contact support" refute Repo.get_by(Plausible.Site, domain: domain) end @@ -291,7 +291,7 @@ defmodule PlausibleWeb.SiteControllerTest do }) assert html_response(conn, 200) =~ - "This domain has already been taken. Perhaps one of your team members registered it? If that's not the case, please contact support@plausible.io" + "This domain cannot be registered. Perhaps one of your colleagues registered it?" end end