Sha256: 5948f043bc303e9d2568379d06d6eac16b906b98a25ace48c964d0ae72e4a20d

Contents?: true

Size: 963 Bytes

Versions: 27

Compression:

Stored size: 963 Bytes

Contents

require 'spec_helper'

feature 'Shopping' do
  scenario 'buying a product' do
    visit '/'
    expect(page).to have_content('Cart ($0.00)')

    add_product_to_cart
    expect(page).to have_content('Cart ($10.00)')

    click_button 'Checkout'
    expect(page).to have_content('One moment...')

    click_button 'Checkout'
    expect(page).to have_content('Thank You. Your order has been placed.')
    expect(page).to have_content('Cart ($0.00)')
  end

  scenario 'updating a cart' do
    add_product_to_cart
    fill_in 'item_1_qty', :with => 3
    click_button 'Update'
    expect(page).to have_content('Cart ($30.00)')
  end

  scenario 'removing a product' do
    add_product_to_cart
    fill_in 'item_1_qty', :with => 0
    click_button 'Update'
    expect(page).to have_content('Cart ($0.00)')
    expect(page).to have_content('Your cart is empty')
  end

  def add_product_to_cart
    visit '/product/my-product'
    click_button 'Add to Cart'
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
dugway-0.10.5 spec/features/shopping_spec.rb
dugway-0.10.4 spec/features/shopping_spec.rb
dugway-0.10.3 spec/features/shopping_spec.rb
dugway-0.10.2 spec/features/shopping_spec.rb
dugway-0.10.1 spec/features/shopping_spec.rb
dugway-0.10.0 spec/features/shopping_spec.rb
dugway-0.9.0 spec/features/shopping_spec.rb
dugway-0.8.4 spec/features/shopping_spec.rb
dugway-0.8.3 spec/features/shopping_spec.rb
dugway-0.8.2 spec/features/shopping_spec.rb
dugway-0.8.1 spec/features/shopping_spec.rb
dugway-0.8.0 spec/features/shopping_spec.rb
dugway-0.7.1 spec/features/shopping_spec.rb
dugway-0.7.0 spec/features/shopping_spec.rb
dugway-0.6.7 spec/features/shopping_spec.rb
dugway-0.6.6 spec/features/shopping_spec.rb
dugway-0.6.5 spec/features/shopping_spec.rb
dugway-0.6.4 spec/features/shopping_spec.rb
dugway-0.6.3 spec/features/shopping_spec.rb
dugway-0.6.2 spec/features/shopping_spec.rb