Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorBenjamin Neff <benjamin@coding4coffee.ch>2022-10-31 02:43:50 +0300
committerBenjamin Neff <benjamin@coding4coffee.ch>2022-10-31 03:45:13 +0300
commit8334eeeeff869b2de4457cf5004e490a01542d44 (patch)
tree0bc4b25dfa8135c81cb2bd890f6d9e80f127259b /spec
parent6bdf6f03b4f0dec3e5545ae88584ef82da4c1a84 (diff)
Ensure pod urls are always lowercase
otherwise pods can exist multiple times with mixed case
Diffstat (limited to 'spec')
-rw-r--r--spec/models/pod_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/models/pod_spec.rb b/spec/models/pod_spec.rb
index 4c41f0173..2e3bc9b09 100644
--- a/spec/models/pod_spec.rb
+++ b/spec/models/pod_spec.rb
@@ -43,6 +43,11 @@ describe Pod, type: :model do
expect(pod.port).to eq(Pod::DEFAULT_PORT)
end
+ it "normalizes hostname to lowercase" do
+ pod = Pod.find_or_create_by(url: "https://eXaMpLe.oRg/")
+ expect(pod.host).to eq("example.org")
+ end
+
context "validation" do
it "is valid" do
pod = Pod.find_or_create_by(url: "https://example.org/")