Skip to content

Instantly share code, notes, and snippets.

@phoet
Last active November 18, 2020 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phoet/37f206376b90df31fc47b98325e0a49f to your computer and use it in GitHub Desktop.
Save phoet/37f206376b90df31fc47b98325e0a49f to your computer and use it in GitHub Desktop.
translate bug
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
gem "rails", "~> 6.0.3"
# gem "rails", "6.1.0.rc1"
# gem "rails", github: 'rails/rails'
end
require "action_view"
require "active_support"
require "active_support/core_ext/object/blank"
require "minitest/autorun"
ActionView::Base.raise_on_missing_translations = true
module UsersHelper
def link_to_user
link_to "hi #{t(nil, default: '-')}", "/ho"
end
end
class UsersHelperTest < ActionView::TestCase
test "should not fail" do
assert_dom_equal %{<a href="/ho">hi -</a>}, link_to_user
# <a href="/ho">hi &lt;span class=&quot;translation_missing&quot; title=&quot;translation missing: en, raise: true&quot;&gt;En&lt;/span&gt;</a>
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment