Skip to content

Commit

Permalink
Merge pull request #816 from degica/subdomain-dots
Browse files Browse the repository at this point in the history
Replace dots in review app subdomains
  • Loading branch information
showwin authored Aug 26, 2024
2 parents c4422c9 + 4586c69 commit 4bc8448
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/models/review_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def computed_environment
]
end

# replace underscores and downcase - not valid as subdomain
# replace dots & underscores and downcase - not valid as subdomain
def sanitized_subject
subject.downcase.gsub('_', '-')
subject.downcase.gsub(/[._]/, '-')
end
end
4 changes: 2 additions & 2 deletions spec/models/review_app_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
context 'when an invalid subject is passed' do
let(:review_app) {
group.review_apps.new(
subject: "subject_With_Caps_And_Underscores",
subject: "subject_With_Caps_And.Underscores",
image_name: "image",
image_tag: "tag",
retention: 12 * 3600,
Expand All @@ -57,7 +57,7 @@
expect{review_app.save!}.to_not raise_error
end

it "converts the underscores to hyphens" do
it "converts the dots and underscores to hyphens" do
expect(review_app.to_param).to eq('subject-with-caps-and-underscores')
expect(review_app.slug).to eq('review---subject-with-caps-and-underscores')
end
Expand Down

0 comments on commit 4bc8448

Please sign in to comment.