Sha256: 6ee01d685741a0e43dd119bf0e352b14728fe4f4aee44667713e956151b99180

Contents?: true

Size: 954 Bytes

Versions: 1

Compression:

Stored size: 954 Bytes

Contents

require 'spec_helper'

feature "Receive Payments", %q{
  To earn money
  As a user 
  I want to be able to bill credit cards from my customers 
} do

  let(:customer) { Factory(:customer_with_subscription_and_valid_card, 
                        :email => "john@doe.com") } 
  let(:user)     { Factory(:user) } 

  before do
    sign_in user
  end 

  # TODO: Rewrite this test making it access the API instead
  scenario "receiving payment" , :vcr => { :cassette_name => "jackpot/receiving_payments" } do
    # Dummy html form to simulate a user entering data 
    visit "/payment.html"

    within "form" do 
      fill_in "customer_id",        :with => "#{customer.id}"
      click_button 'confirm' 
    end 

    page.should have_content("success") 
    within('#latest-payments') do 
      page.should have_content('john@doe.com')
      page.should have_content('$3,000.00')
      page.should have_content('less than a minute') 
    end
  end 
end 

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jackpot-0.0.3 spec/requests/jackpot/jackpot_receive_payments_spec.rb