Permalink
Browse files

Add spec for picker_mode

  • Loading branch information...
1 parent 34cdd80 commit 8e8260c9f1ce4797c4e925aaf7f3f06bf47ff006 @julienXX julienXX committed Nov 11, 2012
Showing with 22 additions and 2 deletions.
  1. +1 −1 spec/functional/slider_row_spec.rb
  2. +21 −1 spec/row_type/date_spec.rb
@@ -24,4 +24,4 @@ def controller
drag("Slider Slider", :from => :left)
@form.sections[0].rows[0].value.should == 100
end
-end
+end
View
@@ -59,4 +59,24 @@
@row.text_field.text.should == expected_output
end
end
-end
+
+ # Modes
+ {
+ :date => '1/1/00',
+ :time => '12:57 AM',
+ :datetime => '1/1/00',
+ :countdown => '00:57'
+ }.each do |mode, expected_output|
+
+ it "should display chosen mode date/time format" do
+ @row.format = :short
+ @row.picker_mode = mode
+ cell = @row.make_cell
+ @row.object.picker.date = NSDate.dateWithTimeIntervalSince1970(MILLENIUM)
+ @row.object.picker.trigger UIControlEventValueChanged
+
+ @row.text_field.text.should == expected_output
+ end
+ end
+
+end

0 comments on commit 8e8260c

Please sign in to comment.