Skip to content

Commit 181162e

Browse files
committed
[WIP] User Upgrades Feature Spec
1 parent 24578c9 commit 181162e

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

spec/features/user_upgrades_spec.rb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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

0 commit comments

Comments
 (0)