Skip to content

Instantly share code, notes, and snippets.

@nowk
Last active December 20, 2015 14:39
Show Gist options
  • Save nowk/6148337 to your computer and use it in GitHub Desktop.
Save nowk/6148337 to your computer and use it in GitHub Desktop.
Capybara JS quirks using angular.js and/or turbolinks
step %{I save a task without the required fields} do
within_task_form do
# NOTE filling with '' won't work as it does not trigger keypress events
# and thus breaks angular bindings
fill_in 'task_name', with: ' '
end
step %{I save the task}
end
step %{the task should be :task_state} do |task_state|
within '.tag-list .dropdown.task-state' do
expect(page).to have_css '.dropdown-toggle', text: task_state.capitalize
toggle_dropdown # NOTE needed to get next assertion, else finder returns '' for some reason
expect(page).to have_css '.dropdown-menu .active', text: task_state.capitalize
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment