File: humanize_spec.rb

package info (click to toggle)
ruby-inflecto 0.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 236 kB
  • sloc: ruby: 691; makefile: 2
file content (14 lines) | stat: -rw-r--r-- 367 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
require 'spec_helper'

describe Inflecto do
  describe '.humanize' do
    it 'replaces _ with space: humanizes employee_salary as Employee salary' do
      Inflecto.humanize('employee_salary').should == 'Employee salary'
    end

    it 'strips _id endings: humanizes author_id as Author' do
      Inflecto.humanize('author_id').should == 'Author'
    end
  end
end