Skip to content

Commit e73dd4c

Browse files
committed
Add SystemHelpers file to simplify system tests
1 parent db452f1 commit e73dd4c

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

spec/rails_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,6 @@
6868
config.filter_rails_from_backtrace!
6969
# arbitrary gems may also be filtered via:
7070
# config.filter_gems_from_backtrace("gem name")
71+
72+
config.include SystemHelpers, type: :system
7173
end

spec/support/system_helpers.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module SystemHelpers
2+
def login_as(user)
3+
visit root_path
4+
click_link("Sign In")
5+
fill_in "email", with: user.email
6+
fill_in "password", with: user.password
7+
click_button("Sign in")
8+
end
9+
end

0 commit comments

Comments
 (0)