PageRenderTime 24ms CodeModel.GetById 0ms RepoModel.GetById 1ms app.codeStats 0ms

/wheels/tests/view/formsdateplain/DateSelectTags.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 41 lines | 35 code | 6 blank | 0 comment | 0 complexity | 305226dbe61f32015b5bc42de9b9e87b MD5 | raw file
Possible License(s): Apache-2.0, CPL-1.0
  1. <cfcomponent extends="wheelsMapping.Test">
  2. <cffunction name="setup">
  3. <cfset loc.controller = controller(name="dummy")>
  4. <cfset loc.args = {}>
  5. <cfset loc.args.label = false>
  6. </cffunction>
  7. <cffunction name="test_multiple_labels">
  8. <cfset loc.args.name = "today">
  9. <cfset loc.args.startyear = "1973">
  10. <cfset loc.args.endyear = "1973">
  11. <cfset loc.args.selected = "09/14/1973">
  12. <cfset loc.args.label = "The Month:,The Day:,The Year:">
  13. <cfset loc.e = '<label for="today-month">The Month:<select id="today-month" name="today($month)"><option value="1">January</option><option value="2">February</option><option value="3">March</option><option value="4">April</option><option value="5">May</option><option value="6">June</option><option value="7">July</option><option value="8">August</option><option selected="selected" value="9">September</option><option value="10">October</option><option value="11">November</option><option value="12">December</option></select></label> <label for="today-day">The Day:<select id="today-day" name="today($day)"><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option selected="selected" value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option><option value="31">31</option></select></label> <label for="today-year">The Year:<select id="today-year" name="today($year)"><option selected="selected" value="1973">1973</option></select></label>'>
  14. <cfset loc.r = loc.controller.dateSelectTags(argumentcollection=loc.args)>
  15. <cfset assert("loc.e eq loc.r")>
  16. </cffunction>
  17. <cffunction name="test_startyear_is_greater_than_endyear">
  18. <cfset loc.args.name = "today">
  19. <cfset loc.args.startyear = "2000">
  20. <cfset loc.args.endyear = "1990">
  21. <cfset loc.args.order="year">
  22. <cfset loc.e = '<select id="today-year" name="today($year)"><option value="2000">2000</option><option value="1999">1999</option><option value="1998">1998</option><option value="1997">1997</option><option value="1996">1996</option><option value="1995">1995</option><option value="1994">1994</option><option value="1993">1993</option><option value="1992">1992</option><option value="1991">1991</option><option value="1990">1990</option></select>'>
  23. <cfset loc.r = loc.controller.dateSelectTags(argumentcollection=loc.args)>
  24. <cfset assert("loc.e eq loc.r")>
  25. </cffunction>
  26. <cffunction name="test_endyear_is_greater_than_startyear">
  27. <cfset loc.args.name = "today">
  28. <cfset loc.args.startyear = "1990">
  29. <cfset loc.args.endyear = "2000">
  30. <cfset loc.args.order="year">
  31. <cfset loc.e = '<select id="today-year" name="today($year)"><option value="1990">1990</option><option value="1991">1991</option><option value="1992">1992</option><option value="1993">1993</option><option value="1994">1994</option><option value="1995">1995</option><option value="1996">1996</option><option value="1997">1997</option><option value="1998">1998</option><option value="1999">1999</option><option value="2000">2000</option></select>'>
  32. <cfset loc.r = loc.controller.dateSelectTags(argumentcollection=loc.args)>
  33. <cfset assert("loc.e eq loc.r")>
  34. </cffunction>
  35. </cfcomponent>