Commit
…arch, url, number, etc) (Closes #3646) [Stephen Celis]
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -349,6 +349,36 @@ def test_text_area_with_size_option | |
) | ||
end | ||
|
||
def search_field | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
expected = %{<input id="contact_notes_query" size="30" name="contact[notes_query]" type="search" />} | ||
assert_dom_equal(expected, search_field("contact", "notes_query")) | ||
end | ||
|
||
def test_telephone_field | ||
expected = %{<input id="user_cell" size="30" name="user[cell]" type="tel" />} | ||
assert_dom_equal(expected, telephone_field("user", "cell")) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
arthurschreiber
Contributor
|
||
end | ||
|
||
def test_url_field | ||
expected = %{<input id="user_homepage" size="30" name="user[homepage]" type="url" />} | ||
assert_dom_equal(expected, url_field("user", "homepage")) | ||
end | ||
|
||
def test_email_field | ||
expected = %{<input id="user_address" size="30" name="user[address]" type="email" />} | ||
assert_dom_equal(expected, email_field("user", "address")) | ||
end | ||
|
||
def test_number_field | ||
expected = %{<input name="order[quantity]" size="30" max="9" id="order_quantity" type="number" min="1" />} | ||
assert_dom_equal(expected, number_field("order", "quantity", :in => 1...10)) | ||
end | ||
|
||
def test_range_input | ||
expected = %{<input name="hifi[volume]" step="0.1" size="30" max="11" id="hifi_volume" type="range" min="0" />} | ||
assert_dom_equal(expected, range_field("hifi", "volume", :in => 0..11, :step => 0.1)) | ||
end | ||
|
||
def test_explicit_name | ||
assert_dom_equal( | ||
'<input id="post_title" name="dont guess" size="30" type="text" value="Hello World" />', text_field("post", "title", "name" => "dont guess") | ||
|
9 comments
on commit f8730e5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You bloody ripper :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, been looking out for this commit. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Thanks for handling the merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened to date type input?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are currently a ton of date input types in the HTML5 spec: datetime, datetime-local, date, month, time, week.
The only browser that comes close to supporting them (at the time) is Opera. Till the spec is more finalized, and till more browsers support these input types, it probably makes more sense to just pass it to the :type option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But with a little javascript help, other browsers are becoming supported too, such as jquerytools' dateinput tool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love.
Shouldn't it be test_search_field?