{"action":"created","issue":{"url":"https://api.github.com/repos/jnicklas/capybara/issues/1548","labels_url":"https://api.github.com/repos/jnicklas/capybara/issues/1548/labels{/name}","comments_url":"https://api.github.com/repos/jnicklas/capybara/issues/1548/comments","events_url":"https://api.github.com/repos/jnicklas/capybara/issues/1548/events","html_url":"https://github.com/jnicklas/capybara/issues/1548","id":95243544,"number":1548,"title":"check/choose do not work with label values","user":{"login":"killthekitten","id":1201569,"avatar_url":"https://avatars.githubusercontent.com/u/1201569?v=3","gravatar_id":"","url":"https://api.github.com/users/killthekitten","html_url":"https://github.com/killthekitten","followers_url":"https://api.github.com/users/killthekitten/followers","following_url":"https://api.github.com/users/killthekitten/following{/other_user}","gists_url":"https://api.github.com/users/killthekitten/gists{/gist_id}","starred_url":"https://api.github.com/users/killthekitten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/killthekitten/subscriptions","organizations_url":"https://api.github.com/users/killthekitten/orgs","repos_url":"https://api.github.com/users/killthekitten/repos","events_url":"https://api.github.com/users/killthekitten/events{/privacy}","received_events_url":"https://api.github.com/users/killthekitten/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-15T17:08:02Z","updated_at":"2015-07-16T17:49:14Z","closed_at":null,"body":"I can't choose/check options via default `check` /  `choose` helpers of capybara, while switching to `find` works:\r\n```ruby\r\n# Not working specs:\r\ncheck(\"Alterna\")\r\n# => Unable to find checkbox \"Alterna\"\r\nchoose(\"Aveda\")\r\n# => Unable to find radio button \"Aveda\"\r\n\r\n# Working specs:\r\nfind(\"label\", text: \"Alterna\").click\r\nfind(\"label\", text: \"Aveda\").click\r\n```\r\nHTML:\r\n```html\r\n<span class=\"checkbox b-survey__answer__choice\">\r\n  <input class=\"check_boxes optional g-checkbox\" type=\"checkbox\" value=\"3\" name=\"survey_answer[choices_answer][]\" id=\"survey_answer_choices_answer_3\">\r\n  <label class=\"collection_check_boxes\" for=\"survey_answer_choices_answer_3\">Alterna</label>\r\n</span>\r\n...\r\n<span class=\"radio b-survey__answer__choice\">\r\n  <input class=\"radio_buttons optional g-checkbox\" type=\"radio\" value=\"2\" name=\"survey_answer[choices_answer]\" id=\"survey_answer_choices_answer_2\">\r\n  <label class=\"collection_radio_buttons\" for=\"survey_answer_choices_answer_2\">Aveda</label>\r\n</span>\r\n```\r\n\r\nSetup is `capybara (2.5.0.dev)` + `poltergeist (1.6.0)`.\r\n\r\nHTML snippets are from different steps of form and get rendered after an ajax call, just so you know*"},"comment":{"url":"https://api.github.com/repos/jnicklas/capybara/issues/comments/122033594","html_url":"https://github.com/jnicklas/capybara/issues/1548#issuecomment-122033594","issue_url":"https://api.github.com/repos/jnicklas/capybara/issues/1548","id":122033594,"user":{"login":"twalpole","id":16556,"avatar_url":"https://avatars.githubusercontent.com/u/16556?v=3","gravatar_id":"","url":"https://api.github.com/users/twalpole","html_url":"https://github.com/twalpole","followers_url":"https://api.github.com/users/twalpole/followers","following_url":"https://api.github.com/users/twalpole/following{/other_user}","gists_url":"https://api.github.com/users/twalpole/gists{/gist_id}","starred_url":"https://api.github.com/users/twalpole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twalpole/subscriptions","organizations_url":"https://api.github.com/users/twalpole/orgs","repos_url":"https://api.github.com/users/twalpole/repos","events_url":"https://api.github.com/users/twalpole/events{/privacy}","received_events_url":"https://api.github.com/users/twalpole/received_events","type":"User","site_admin":false},"created_at":"2015-07-16T17:49:13Z","updated_at":"2015-07-16T17:49:13Z","body":"Are the checkbox and radio button visible?  If you are hiding them and highlighting the labels to show selected state, then this behavior is correct/as designed since a user cannot click on a hidden checkbox/radio button.   "}}