summaryrefslogtreecommitdiff
path: root/spec/support/web_page.rb
blob: 4144c8666ab1f66849af1c7841b0b533075eaa8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
class WebPage
  include Capybara::DSL
  include Rails.application.routes.url_helpers
  attr_reader :page_path

  def initialize(page_path)
    @page_path = page_path
  end

  def visit_page
    visit page_path
    self
  end

  def on_page?
    current_path == page_path
  end
end