summaryrefslogtreecommitdiff
path: root/spec/support/pages/login_page.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/pages/login_page.rb')
-rw-r--r--spec/support/pages/login_page.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/support/pages/login_page.rb b/spec/support/pages/login_page.rb
new file mode 100644
index 0000000..616603a
--- /dev/null
+++ b/spec/support/pages/login_page.rb
@@ -0,0 +1,14 @@
+class LoginPage
+ include Capybara::DSL
+ include Rails.application.routes.url_helpers
+
+ def login_with(email:, password:)
+ visit root_path
+ within ".form-signin" do
+ fill_in 'email', with: email
+ fill_in 'password', with: password
+ end
+ click_button "Sign in"
+ end
+end
+