Module: Capybara::RSpecMatchers

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

Defined Under Namespace

Classes: HaveMatcher, HaveSelector

Instance Method Summary collapse

Instance Method Details

#have_button(locator) ⇒ Object



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

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

#have_checked_field(locator) ⇒ Object



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

def have_checked_field(locator)
  HaveMatcher.new(:checked_field, locator)
end

#have_content(text) ⇒ Object



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

def have_content(text)
  HaveMatcher.new(:content, text.to_s) do |page, matcher|
    %(expected there to be content #{matcher.locator.inspect} in #{page.text.inspect})
  end
end

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



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

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

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



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

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


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

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

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



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

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

#have_selector(*args) ⇒ Object



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

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

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



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

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

#have_unchecked_field(locator) ⇒ Object



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

def have_unchecked_field(locator)
  HaveMatcher.new(:unchecked_field, locator)
end

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



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

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