Sha256: 2cea78fdf81907fc6f2987829159651d22e296f50bb0231edc58159834e5787f

Contents?: true

Size: 1.19 KB

Versions: 1

Compression:

Stored size: 1.19 KB

Contents

module SimpleCart
  feature 'Checkout Step 2: Delivery' do
    let(:order) do
      FactoryGirl.create(:order, 
             :order_items      => [FactoryGirl.create(:order_item)], 
             :billing_address  => FactoryGirl.create(:billing_address),
             :shipping_address => FactoryGirl.create(:shipping_address),
             :delivery         => FactoryGirl.create(:delivery),
             :credit_card      => FactoryGirl.create(:credit_card))
    end

    background do
      visit simple_cart.order_checkout_path(order, :confirm)
    end

    scenario 'it reaches Step 4 Confirmation' do
      expect(current_path).to include('confirm')
    end

    scenario 'user can go back and forth to any step now' do
      click_link('Address')
      expect(current_path).to include('billing')
      click_link('Delivery')
      expect(current_path).to include('delivery')
      click_link('Payment')
      expect(current_path).to include('payment')
      click_link('Confirm')
      expect(current_path).to include('confirm')
    end

    scenario 'user can procceed to the user\'s order when placed' do
      click_link('Place order')
      expect(current_path).to include("#{order.id}")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
simple_cart-0.0.5 spec/features/simple_cart/checkout/4_confirmation_feature_spec.rb