- Added select tag test for verifying passing html options to f.select helper

- Renamed test to be more descriptive
This commit is contained in:
Vipul A M 2016-06-28 14:22:42 -07:00
parent af874cc57f
commit 4582a36617
No known key found for this signature in database
GPG Key ID: 4C9362FE1F574587
1 changed files with 10 additions and 1 deletions

View File

@ -738,7 +738,7 @@ class FormOptionsHelperTest < ActionView::TestCase
)
end
def test_empty
def test_select_with_empty
@post = Post.new
@post.category = ""
assert_dom_equal(
@ -747,6 +747,15 @@ class FormOptionsHelperTest < ActionView::TestCase
)
end
def test_select_with_html_options
@post = Post.new
@post.category = ""
assert_dom_equal(
"<select class=\"disabled\" disabled=\"disabled\" name=\"post[category]\" id=\"post_category\"><option value=\"\">Please select</option>\n<option value=\"\"></option>\n</select>",
select("post", "category", [], { prompt: true, include_blank: true }, { class: 'disabled', disabled: true })
)
end
def test_select_with_nil
@post = Post.new
@post.category = "othervalue"