Skip to content

Commit 4c9e49e

Browse files
committed
Feature specs: Navigate via links rather than visits
We want to test the site like a real user, not like someone constantly changing the URL bar in a browser. Let's have the specs click links.
1 parent b4f178a commit 4c9e49e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

spec/features/checkout_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
click_link "RoR Mug"
8181
click_button "Add To Cart"
8282

83-
visit spree.login_path
83+
click_link "Login"
8484
fill_in "Email", with: user.email
8585
fill_in "Password", with: user.password
8686
click_button "Login"
@@ -113,7 +113,7 @@
113113
click_link "RoR Mug"
114114
click_button "Add To Cart"
115115

116-
visit spree.login_path
116+
click_link "Login"
117117
click_link "Forgot Password?"
118118
fill_in "spree_user_email", with: "email@person.com"
119119
click_button "Reset my password"

spec/features/order_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
click_link "RoR Mug"
2121
click_button "Add To Cart"
2222

23-
visit spree.login_path
23+
click_link "Login"
2424
fill_in "Email", with: user.email
2525
fill_in "Password", with: user.password
2626
click_button "Login"
@@ -35,7 +35,7 @@
3535
click_link "RoR Shirt"
3636
click_button "Add To Cart"
3737

38-
visit spree.login_path
38+
click_link "Login"
3939
fill_in "Email", with: user.email
4040
fill_in "Password", with: user.password
4141
click_button "Login"

0 commit comments

Comments
 (0)