aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/translation_helper_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Ignore scope in missing translation input.Kasper Timm Hansen2015-10-281-0/+8
| | | | | | It's already represented in the key name. Demonstrate with a test. Also test that the default isn't output.
* Include interpolation values to translation_missing helperKir Shatrov2015-09-181-0/+6
|
* Removed Mocha from ActionView part 1Ronak Jangir2015-08-241-5/+8
|
* Remove :rescue_format option for translate helper since it's no longer ↵Bernard Potocki2015-05-041-14/+2
| | | | supported by I18n.
* Handle raise flag in translate when both main and default translation is ↵Bernard Potocki2015-05-041-0/+13
| | | | missing. Fixes #19967
* Allow an array to be a default translation value.Adam Prescott2015-04-041-0/+5
| | | | | | | | | | | 4.2.1 introduced a change to the way `translate`/`t` works with an option of `default: [[]]`. In 4.2.0, this would give a default value of `[]`, but in 4.2.1, it leads to a missing translation. `default: [[]]` is again allowed for cases where a default of `[]` is needed. This addresses GitHub issue 19640.
* Merge pull request #19421 from jcoyne/translate_defaults_with_nilRafael Mendonça França2015-03-201-0/+5
| | | | Strip nils out of default translations. Fixes #19419
* Fix regression when passing a value different of String.Ulisses Almeida2015-02-261-0/+5
| | | | | | | | | | | | | | | | | The previous version of rails(4.2.0) you can pass objects to the default option of translation helper. For example: ```ruby t('foo', default: 1) ``` But on rails 4.2.1 version this kind of use stopped to work, because started only to accept String types. Now with this fix we can use orther value types on this helper again.
* Avoid changing the global state on the testsRafael Mendonça França2015-01-051-1/+6
|
* Merge pull request #17676 from ↵Rafael Mendonça França2015-01-051-0/+19
|\ | | | | | | | | | | tigrish/fix_custom_i18n_exception_handler_regression Fix I18n regression introduced by #13832
| * Fix I18n regression introduced by #13832Christopher Dell2014-11-191-0/+19
| | | | | | | | Previously, when the `:raise` options was set to `false`, it would get overwritten to `true`, preventing custom exception handlers to be used.
* | Unsafe default translations should not be marked html_safeJustin Coyne2015-01-021-0/+6
|/ | | | | | Previously default translation keys that didn't end in `_html`, but came after a missing key that ended in `_html` were being returned as html_safe. Now they are not. Fixes #18257
* fix the undefined method content_tag #15245Rajarshi Das2014-09-061-1/+0
| | | | not required include ActionView::Helpers::TagHelper in test as well
* Clean up I18n stored translations after test.Zuhao Wan2014-06-141-1/+5
|
* Fix assertion order and :scissors: extra spacesCarlos Antonio da Silva2014-05-131-2/+2
|
* Dup options hash to prevent modificationsJosep Jaume Rey2014-05-131-0/+6
| | | | `options[:default]` and `options[:raise]` can be mistakenly added to the `options` hash. This can be a problem if you're reusing the same object.
* Rails config for raise on missing translationsKassio Borges2014-01-271-0/+10
| | | | | Add a config to setup whether raise exception for missing translation or not.
* Escalate missing error when :raise is trueShota Fukumori (sora_h)2013-12-051-0/+6
| | | | | | | | | | | | | | Before ec16ba75a5493b9da972eea08bae630eba35b62f, ActionView::Helpers::TranslationHelper#translate has raised errors with specifying options[:raise] to true. This should work by this fix: begin t(:"translations.missing", raise: true) rescue I18n::MissingTranslationData p :hello! end
* Stop using i18n's built in HTML error handling.Michael Koziarski2013-12-021-1/+1
| | | | | | | | | i18n doesn't depend on active support which means it can't use our html_safe code to do its escaping when generating the spans. Rather than try to sanitize the output from i18n, just revert to our old behaviour of rescuing the error and constructing the tag ourselves. Fixes: CVE-2013-4491
* Move template tests from actionpack to actionviewPiotr Sarnacki2013-06-201-0/+138