Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support https url scheme (add Faker::Internet.secure_url) #460

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/faker/internet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ def url(host = domain_name, path = "/#{user_name}")
"http://#{host}#{path}"
end

def secure_url(host = domain_name, path = "/#{user_name}")
"https://#{host}#{path}"
end

def slug(words = nil, glue = nil)
glue ||= %w[- _ .].sample
(words || Faker::Lorem::words(2).join(' ')).gsub(' ', glue).downcase
Expand Down
4 changes: 4 additions & 0 deletions test/test_faker_internet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ def test_url
assert @tester.url('domain.com', '/username').match(/^http:\/\/domain\.com\/username$/)
end

def test_secure_url
assert @tester.secure_url('domain.com', '/username').match(/^https:\/\/domain\.com\/username$/)
end

def test_device_token
assert_equal 64, @tester.device_token.size
end
Expand Down