Skip to content

Instantly share code, notes, and snippets.

@jaymiejones86
Last active January 5, 2016 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaymiejones86/965d89374d5196e7f061 to your computer and use it in GitHub Desktop.
Save jaymiejones86/965d89374d5196e7f061 to your computer and use it in GitHub Desktop.
React select box selection
scenario 'I can select an option through js rendered element', js: true do
fill_in 'email', with: 'john@example.com'
script = "$('#role').val('admin')"
page.execute_script(script)
page.execute_script("React.addons.TestUtils.Simulate.change(document.getElementById('role'))")
click_button 'Add User'
expect(unread_emails_for('john@example.com').size).to eq(1)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment