Skip to content

Instantly share code, notes, and snippets.

@phoet

phoet/example.rb

Last active Nov 18, 2020
Embed
What would you like to do?
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