Skip to content

Commit

Permalink
fix rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
jacklynhma committed Dec 15, 2024
1 parent 7fcdc6b commit 25412b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions app/helpers/url_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module UrlHelper
module UrlHelper
def append_https(url)
return "" if url.blank?
return url if url.start_with?("https://")
return "https://#{url}"
end
end
"https://#{url}"
end
end
6 changes: 3 additions & 3 deletions test/unit/helpers/url_helper_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require "test_helper"

class UrlHelperTest < ActionView::TestCase
context"append_https" do
context "append_https" do
should "return url if it begins with https" do
assert_equal "https://www.awesomesite.com", append_https("https://www.awesomesite.com")
end
Expand All @@ -16,5 +16,5 @@ class UrlHelperTest < ActionView::TestCase
should "return empty string if url is nil" do
assert_equal "", append_https(nil)
end
end
end
end
end

0 comments on commit 25412b2

Please sign in to comment.