lundi 23 février 2015

Testing Stripe works with js: true, but it makes other components work incorrectly

Testing the stripe framework requires Javascript to be turned on, but when I send js: true in it method, the other components like visit, fill_in stop working in the way they were working before.


Here is my code:



def sign_up(subdomain)
visit root_url(subdomain: false)
visit new_account_path
fill_in 'Name', with: 'Ryan'
fill_in 'Email', with: 'test@test.com'
fill_in 'Password', with: 'password'
fill_in 'Password confirmation', with: 'password'
fill_in 'Subdomain', with: subdomain
click_button 'Create Account'
end


In the sign_up method, visit new_account_path was working before js: true, but now it doesn't.


I'm turning js: true in the following method:



it 'shows the user can upgrade his account with valid card number, expiration and CVC', js: true do
fill_in "card_number", :with => "4242424242424242"
fill_in "card_expiry_month", :with => "05"
fill_in "card_expiry_year", :with => "2015"
fill_in "card_cvc", :with => "123"
click_button 'Upgrade Your Account'
expect(page).to have_content "Update Your Payment Information"
end


I've been searching the solution for quite a long time, but so far unable to resolve this.


Aucun commentaire:

Enregistrer un commentaire