Skip to content

Commit

Permalink
Merge pull request #637 from moneyadviceservice/increase-url-length
Browse files Browse the repository at this point in the history
Increase allowed website lengths to 300
  • Loading branch information
benlovell authored May 17, 2024
2 parents 3af0776 + 2fa7f83 commit 550fc72
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/models/firm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def self.languages_used
with_options on: :update do |firm|
firm.validates :website_address,
allow_blank: true,
length: { maximum: 120 },
length: { maximum: 300 },
format: { with: /\A(https?:\/\/)?([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]+/ }

firm.validates :free_initial_meeting,
Expand Down
2 changes: 1 addition & 1 deletion app/models/office.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Office < ApplicationRecord

validates :website,
allow_blank: true,
length: { maximum: 100 },
length: { maximum: 300 },
format: { with: /\A(https?:\/\/)?([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]+/ }

validates :disabled_access, inclusion: { in: [true, false] }
Expand Down
4 changes: 2 additions & 2 deletions spec/models/firm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ def set_marker_field(firm, value)

context 'on update' do
describe 'website_address' do
it 'must not exceed 120 characters' do
firm.website_address = "#{'a' * 120}.com"
it 'must not exceed 300 characters' do
firm.website_address = "#{'a' * 300}.com"
expect(firm).to_not be_valid
end

Expand Down
4 changes: 2 additions & 2 deletions spec/models/office_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@
end

describe 'website url' do
it 'must not exceed 100 characters' do
office.website = "#{'a' * 100}.com"
it 'must not exceed 300 characters' do
office.website = "#{'a' * 300}.com"
expect(office).to_not be_valid
end

Expand Down

0 comments on commit 550fc72

Please sign in to comment.