Skip to content

Commit

Permalink
Add spec for picker_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
julienXX committed Nov 11, 2012
1 parent 34cdd80 commit 8e8260c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/functional/slider_row_spec.rb
Expand Up @@ -24,4 +24,4 @@ def controller
drag("Slider Slider", :from => :left)
@form.sections[0].rows[0].value.should == 100
end
end
end
22 changes: 21 additions & 1 deletion spec/row_type/date_spec.rb
Expand Up @@ -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.