renamed module DateHelper to InstanceTag

This commit is contained in:
Adam Meehan
2008-07-07 09:50:29 +10:00
parent 6ffb7e5780
commit 5edfa5f2fc
4 changed files with 54 additions and 57 deletions

View File

@@ -1,11 +0,0 @@
#require File.dirname(__FILE__) + '/spec_helper'
#describe ValidatesTimeliness::DateHelper::InstanceTag do
# it "should return struct for time string" do
# object = mock("Model", :birth_date_and_time_before_type_cast => "2008-01-01 12:00:00")
# struct = value_with_timeliness(object)
# struct.should be_kind_of(DateTimeStruct)
# end
#end

18
spec/instance_tag_spec.rb Normal file
View File

@@ -0,0 +1,18 @@
require File.dirname(__FILE__) + '/spec_helper'
describe ValidatesTimeliness::InstanceTag, :type => :helper do
before do
@person = Person.new
end
it "should return struct for time string" do
@person.birth_date_and_time = "2008-02-30 12:00:00"
output = date_select(:person, :birth_date_and_time, :include_blank => true)
puts output
output.should have_tag('select') do
with_tag('input[type=text]', 3)
end
end
end