File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ require "rails_helper"
2+
3+ feature "User upgrades" , js : true do
4+
5+ scenario "successfully" do
6+ user = create ( :user , role : "standard" )
7+
8+ visit new_user_session_path
9+ login user
10+ click_button "Upgrade Membership"
11+
12+ within_frame "stripe_checkout_app" do
13+ fill_in "Email" , with : user . email
14+ fill_in_stripe_field "#card_number" , with : "4242424242424242"
15+ fill_in_stripe_field "#cc-exp" , with : "12/22"
16+ fill_in "CVC" , with : '123'
17+ click_button "Pay $9.99"
18+ end
19+
20+ expect ( page ) . to have_content "Thank you for upgrading your membership!"
21+ expect ( page ) . not_to have_css "button" , text : "Upgrade Membership"
22+ expect ( user . reload . premium? ) . to eq true
23+ end
24+
25+ xscenario "unsuccessfully"
26+
27+ end
You can’t perform that action at this time.
0 commit comments