# encoding: UTF-8 require 'spec_helper' describe UtilityHelper do include CrudTestHelper before(:all) do reset_db setup_db create_test_data end after(:all) { reset_db } describe '#column_type' do let(:model) { crud_test_models(:AAAAA) } it 'should recognize types' do column_type(model, :name).should == :string column_type(model, :children).should == :integer column_type(model, :companion_id).should == :integer column_type(model, :rating).should == :float column_type(model, :income).should == :decimal column_type(model, :birthdate).should == :date column_type(model, :gets_up_at).should == :time column_type(model, :last_seen).should == :datetime column_type(model, :human).should == :boolean column_type(model, :remarks).should == :text column_type(model, :companion).should be_nil end end describe '#content_tag_nested' do it 'should escape safe content' do html = content_tag_nested(:div, %w(a b)) { |e| content_tag(:span, e) } html.should be_html_safe html.should == '