Sha256: 5ff84a7dbd808de813d2b8925f31ab28e92bd09c01dcd4171ba030c40c8746d4
Contents?: true
Size: 1.62 KB
Versions: 2
Compression:
Stored size: 1.62 KB
Contents
require 'spec_helper' require 'action_view' describe 'dt_picker spec:' do before do ExtForm.setup do |e| e.layout = 'BootstrapLayout' e.default_wrapper = :ext_bootstrap e.default_layout = { layout: '1:1', spacing: '1', label_width: '2', max_width: '12' } end end let(:order_header) { FactoryGirl.create(:order_header) } context 'date options' do subject { helper.ext_form_for(order_header) do |f| f.input :order_date end } it 'order_date should render date_picker' do expect(subject).to match /<input.*data-format="yyyy-MM-dd" data-language="zh-CN" data-pick-time="false"/ expect(subject).to match /<span class="add-on"><i data-date-icon="icon-calendar" data-time-icon="icon-time"/ end end context 'time options' do subject { helper.ext_form_for(order_header) do |f| f.input :order_number, as: :time_picker, input_html: {data: {start_date: '2012-2-2', end_date: '2012-3-3'}} end } it 'order_date should render time_picker' do expect(subject).to match /<input.*data-format="hh:mm:ss" data-language="zh-CN" data-pick-date="false"/ expect(subject).to match /data-start-date="2012-2-2"/ expect(subject).to match /data-end-date="2012-3-3"/ end end context 'datetime options' do subject { helper.ext_form_for(order_header) do |f| f.input :order_number, as: :dt_picker end } it 'order_date should render dt_picker' do expect(subject).to match /<input.*data-format="yyyy-MM-dd hh:mm:ss" data-language="zh-CN"/ end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ext_form-0.1.5 | spec/helpers/dt_picker_spec.rb |
ext_form-0.1.4 | spec/helpers/dt_picker_spec.rb |