/guest_creates_pledge_spec.rb Secret
Created
April 26, 2018 07:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
feature 'Guest creates a pledge', js: true do | |
VALID_CARD_NUMBER = '4242424242424242' | |
scenario 'using radio buttons to choose amount' do | |
school = create(:school) | |
visit school_path(school) | |
choose '$15' | |
fill_and_submit_pledge_form | |
expect(page).to have_content('Thank you for your donation') | |
end | |
def fill_and_submit_pledge_form | |
fill_in 'Email', with: 'tester@example.com' | |
fill_in 'Card number', with: VALID_CARD_NUMBER | |
fill_in 'Expires', with: '10/20' | |
fill_in 'Name on card', with: 'Ralph Robot' | |
fill_in 'Card code', with: '911' | |
click_button 'Send my monthly donation!' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment