module PageLoadAssertions

assertions for use with Capybara @note requires rspec 3 or greater

Public Instance Methods

should_404(path) click to toggle source

Asserts that the path is being displayed but with HTTP error code 404 @param path [String] what you're expecting to return 404 after the user visits

# File lib/subelsky_power_tools/page_load_assertions.rb, line 19
def should_404(path)
  expect(page.current_path).to eq(path)
  expect(page.status_code).to eq(404)
end
should_load(path) click to toggle source

Asserts that the correct page has been loaded @param path [String] what path you're expecting load successfully after the user visits in a browser

# File lib/subelsky_power_tools/page_load_assertions.rb, line 12
def should_load(path)
  expect(page.current_path).to eq(path)
  expect(page.status_code).to eq(200)
end
visit!(path,*args) click to toggle source

@param path [String] what path to visit

# File lib/subelsky_power_tools/page_load_assertions.rb, line 5
def visit!(path,*args)
  visit path,*args
  should_load(path)
end