Skip to content

Instantly share code, notes, and snippets.

View tyok's full-sized avatar

Mohammad Satrio tyok

View GitHub Profile
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@tyok
tyok / rspec_custom_matcher_capybara.rb
Created November 28, 2011 08:12 — forked from yosemsweet/rspec_custom_matcher_capybara.rb
Capybara matchers in RSpec custom matcher
RSpec::Matchers.define :have_widget_elements_for do |widget|
match do |actual|
puts actual.to_yaml
@errors = {}
expected_elements = {
:widget => ".widget",
:content_type => ".#{widget.content_type}",
:body => ".body",
:title => ".title",