aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/inflector_test_cases.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix for inflector's incorrect camelCase replacement for acronymsMatthew Draper2014-09-061-0/+1
| | | | | | Fixes #8015, #9756. [Fred Wu & Matthew Draper]
* several enhancements to humanize [closes #12288]Xavier Noria2014-05-061-3/+5
| | | | | | | | | | * Strips leading underscores. * Changes some unnecessary gsub!s to sub!s. * Replaces some anchors ^, $ with \A, \z. * Documents that human inflection rules are applied. * Documents that words are downcased except acronyms. * Adds an example with an acronym. * Rewords docs.
* Add a comment to ensure that a test won't be removed [ci skip]Robin Dupret2014-03-031-1/+1
| | | | | | The 'cow' => 'kine' inflection has gone with c300dca9 but it should not be removed from the tested irregularities since it ensures that inflections work with words that do not begin with the same letters.
* wrap test that changes inflections in with_dupLihan Li2013-11-281-0/+1
|
* Add +capitalize+ option to Inflector.humanizeclaudiob2013-11-061-0/+6
| | | | | | | So strings can be humanized without being capitalized: 'employee_salary'.humanize # => "Employee salary" 'employee_salary'.humanize(capitalize: false) # => "employee salary"
* Don't mutate the original inflections instance in the testsAndrew White2013-07-301-1/+0
|
* Inflector irregular singularize rulesJuanjo Bazán2013-01-011-0/+1
|
* Adds missing inflector tests to ensure idempotencyGodfrey Chan2012-06-211-0/+2
| | | | | | | | | | | | | This is a follow up to #4719. It appears that singularize and pluralize are supposed to be idempotent - i.e. when you call singularize or pluralize multiple times on the same string, you should get the same result. (At least for the "officially supported" cases that the stock inflector is designed to handle.) #4719 added the missing tests for regular cases, and this commit added the missing tests for the irregularities. While I'm at that, I also synced up the irregularity test cases with the current set of irregularity cases that we ship out-of-the-box.
* Fix an issue with inflection where my_analyses (in plular form) incorrectly ↵Anuj Dutta2012-05-161-0/+1
| | | | converted to my_analyasis(in singular form).
* Merge pull request #5177 from cap10morgan/fix-gh-issue-4374José Valim2012-04-301-1/+3
|\ | | | | fix inflector bug where -ice gets singularized into -ouse
| * fix inflector bug where -ice gets pluralized into -ouseWes Morgan2012-02-251-1/+3
| | | | | | | | This should happen for mouse or louse, but not slice or pumice.
* | adds a new test case for titleizeXavier Noria2012-04-081-0/+1
| |
* | revises the regexp used in titleizeXavier Noria2012-04-071-12/+15
| | | | | | | | | | | | | | | | | | The regexp used in titleize matches saxon genitive and other contractions, only to call capitalize on the captured text and have the apostrophe upcased which yields the apostrophe itself. It is more clear that the regexp matches just what it has to match.
* | String#titleize works properly with smart quotes, closes #5584Vasiliy Ermolovich2012-03-261-1/+3
|/
* fixes a regression introduced by 532cd4, and a bogus test in AP the ↵Xavier Noria2012-02-101-0/+1
| | | | regression uncovered
* Fix inflection regexes for mouse, miceMark Rushakoff2011-12-071-1/+5
|
* Added the test case for #3537Pavan Kumar Sunkara2011-11-061-0/+1
|
* Revert removing gsub and sub from safe buffer.José Valim2011-09-081-0/+7
|
* remove support of symbols on classify and camelizeDamien Mathieu2011-09-081-7/+0
|
* StringToParameterizeWithNoSeparator: dashed parameter will notArun Agrawal2011-06-251-1/+1
| | | change.
* Test retain delimiter in parameterization inflectorDavid Lee2011-06-111-0/+3
|
* ordinalize negative numbers patchJason2011-05-071-0/+30
| | | | | | | Applied patch by Amir Manji https://github.com/rails/rails/issues/437#issuecomment-1116045 Signed-off-by: Jason <jasonmichaelroth@gmail.com>
* handle double pluralization for irregular pluralsDan Pickett2011-02-161-0/+1
| | | | | | [#6363] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Improve reliability of Inflector.transliterate. [#4374 state:resolved]Norman Clarke2010-04-121-1/+4
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Changed the way inflections for uncountables work for 'funky jeans' [#3576 ↵Rolf Bjaanes2010-04-051-0/+2
| | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Parameterize should accept malformed utf8 characters [#4323 state:resolved]Kristopher Murata2010-04-041-4/+8
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Any reason we can't just use the slow 1.8 path for transliteration in 1.9?wycats2010-03-171-12/+4
|
* Removed the + sign as an accepted character from the parameterize method, as ↵Stijn Mathysen2010-03-051-3/+6
| | | | | | | | a + sign is interpreted by the browser as a space, possibly resulting in a "ArgumentError: illegal character in key" [#4080 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* ensure Inflector.camelize works with symbols [#2856 state:resolved]Yehuda Katz + Carl Lerche2009-07-011-0/+7
| | | Signed-off-by: Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>
* Allow String#parameterize to accept a separator [#2157 state:resolved]Sam Granieri2009-03-071-0/+16
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Adding inflection of databases (usually we wouldn't amend the current ↵Jiri Zajpt2009-02-121-1/+2
| | | | | | defaults, but this seems to obvious) [#1942 state:committed] Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
* Ruby 1.9 compat: no Unicode normalization support yetJeremy Kemper2008-11-261-2/+13
|
* Mark utf-8 source encodingJeremy Kemper2008-10-061-0/+2
|
* Modified ActiveSupport::Inflector#parameterize with code from slugalizer ↵Adam Cigánek2008-09-231-1/+4
| | | | | | | | | (http://github.com/henrik/slugalizer) Handles trailing and leading slashes, and squashes repeated separators into a single character. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#1034 state:committed]
* Flesh out the parameterize method to support non-ascii text and underscores.Michael Koziarski2008-09-111-1/+4
|
* Added Inflector#parameterize for easy slug generation ("Donald E. ↵David Heinemeier Hansson2008-09-101-0/+5
| | | | Knuth".parameterize => "donald-e-knuth") #713 [Matt Darby]
* Fixed String#titleize to work for strings with 's too (closes #10571) [trek]David Heinemeier Hansson2008-01-031-1/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8533 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Extract InflectorTestCases so both inflector and string inflections tests ↵Jeremy Kemper2007-09-271-0/+208
can use them. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7655 5ecf4fe2-1ee6-0310-87b1-e25e094e27de