I am trying to select a switch with capybara and it cannot find the switch. Here is my rspec test, view and error. Please note that I use factories for users, skills, etc.
Rspec test
scenario "user chooses a couple skills and moves on to bio" do user = create(:user) skill = create(:skill) skill_two = create(:skill) skill_three = create(:skill) sign_in(user) visit onboard_skills_path choose(skill.name) end
View
<%= form_for(:onboard_skill, url: onboard_skills_path) do |f| %> <ul> <% @skills.each do |skill| %> <li> <%= check_box_tag("skill_ids[]", skill.id, current_user.onboard_skill_ids.include?(skill.id)) %> <%= f.label(skill.name) %> </li> <% end %> </ul> <%= f.submit "Next >", class: "submit_skills" %> <% end %>
The error I am getting is:
Unable to find radio button "Development 1"
source share