Module: Capybara::RSpecMatchers

Defined in:
lib/capybara/rspec/matchers.rb

Defined Under Namespace

Classes: HaveSelector, HaveText, HaveTitle, Matcher

Instance Method Summary collapse

Instance Method Details

#have_button(locator) ⇒ Object



129
130
131
# File 'lib/capybara/rspec/matchers.rb', line 129

def have_button(locator)
  HaveSelector.new(:button, locator)
end

#have_checked_field(locator) ⇒ Object



137
138
139
# File 'lib/capybara/rspec/matchers.rb', line 137

def have_checked_field(locator)
  HaveSelector.new(:field, locator, :checked => true)
end

#have_css(css, options = {}) ⇒ Object



112
113
114
# File 'lib/capybara/rspec/matchers.rb', line 112

def have_css(css, options={})
  HaveSelector.new(:css, css, options)
end

#have_field(locator, options = {}) ⇒ Object



133
134
135
# File 'lib/capybara/rspec/matchers.rb', line 133

def have_field(locator, options={})
  HaveSelector.new(:field, locator, options)
end


125
126
127
# File 'lib/capybara/rspec/matchers.rb', line 125

def have_link(locator, options={})
  HaveSelector.new(:link, locator, options)
end

#have_select(locator, options = {}) ⇒ Object



145
146
147
# File 'lib/capybara/rspec/matchers.rb', line 145

def have_select(locator, options={})
  HaveSelector.new(:select, locator, options)
end

#have_selector(*args) ⇒ Object



104
105
106
# File 'lib/capybara/rspec/matchers.rb', line 104

def have_selector(*args)
  HaveSelector.new(*args)
end

#have_table(locator, options = {}) ⇒ Object



149
150
151
# File 'lib/capybara/rspec/matchers.rb', line 149

def have_table(locator, options={})
  HaveSelector.new(:table, locator, options)
end

#have_text(*args) ⇒ Object Also known as: have_content



116
117
118
# File 'lib/capybara/rspec/matchers.rb', line 116

def have_text(*args)
  HaveText.new(*args)
end

#have_title(title) ⇒ Object



121
122
123
# File 'lib/capybara/rspec/matchers.rb', line 121

def have_title(title)
  HaveTitle.new(title)
end

#have_unchecked_field(locator) ⇒ Object



141
142
143
# File 'lib/capybara/rspec/matchers.rb', line 141

def have_unchecked_field(locator)
  HaveSelector.new(:field, locator, :unchecked => true)
end

#have_xpath(xpath, options = {}) ⇒ Object



108
109
110
# File 'lib/capybara/rspec/matchers.rb', line 108

def have_xpath(xpath, options={})
  HaveSelector.new(:xpath, xpath, options)
end