class Object
Public Class Methods
feature(*args, &block)
click to toggle source
# File lib/capybara/rspec/features.rb, line 33 def self.feature(*args, &block) options = if args.last.is_a?(Hash) then args.pop else {} end options[:capybara_feature] = true options[:type] = :feature options[:caller] ||= caller args.push(options) #call describe on RSpec in case user has expose_dsl_globally set to false RSpec.describe(*args, &block) end
Public Instance Methods
bases()
click to toggle source
# File lib/capybara/spec/session/current_url_spec.rb, line 9 def bases @servers.map { |s| "http://#{s.host}:#{s.port}" } end
should_be_on(server_index, path="/host", scheme="http")
click to toggle source
# File lib/capybara/spec/session/current_url_spec.rb, line 13 def should_be_on server_index, path="/host", scheme="http" # Check that we are on /host on the given server s = @servers[server_index] expect(@session.current_url.chomp('?')).to eq("#{scheme}://#{s.host}:#{s.port}#{path}") expect(@session.current_host).to eq("#{scheme}://#{s.host}") # no port expect(@session.current_path).to eq(path) if path == '/host' # Server should agree with us expect(@session).to have_content("Current host is #{scheme}://#{s.host}:#{s.port}") end end
visit_host_links()
click to toggle source
# File lib/capybara/spec/session/current_url_spec.rb, line 25 def visit_host_links @session.visit("#{bases[0]}/host_links?absolute_host=#{bases[1]}") end