blob: 3fbace2d5f5897535bd3459aa84f42f39ebde8fe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
class PageModel
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
def has_error?(translation_key)
page.has_content?(translate(translation_key))
end
def translate(key)
I18n.translate(key)
end
end
|