Sha256: ceda1e2429dd8a452e4f1a224963d45b9b032a8d3e80c7b86364601a0e7984e6

Contents?: true

Size: 1.24 KB

Versions: 5

Compression:

Stored size: 1.24 KB

Contents

require 'spec_helper'

feature "minicart", :js => true do
  background { @product = Factory(:product, :name => "ror mug", :price => 30) }

  scenario "customer should be able to add and delete a product in the minicart" do
    visit spree.products_path
    click_link("ror mug")
    click_button "Add To Cart"

    within("#link-to-cart a") do
      page.should have_content("(1)")
    end

    within("#minicart") do
      page.should have_content("ror mug")
      page.should have_content("$30")
    end

    page.execute_script '$("#minicart-items li").trigger("mouseenter")'
    within "li div.minicart-actions" do
      page.should have_content("Delete")
      # manually sliding down the minicart actions, dont know why its not working
      page.execute_script '$("#minicart-items li div.minicart-actions").slideDown()'
      click_link "Delete"
    end

    URI.parse(current_url).path.should =~ /products/

    within("#minicart") do
      page.should_not have_content("ror mug")
      page.should_not have_content("$30")
    end

  end

  scenario 'minicart should not freak out standard cart', :js => false do
    visit spree.products_path
    click_link("ror mug")
    click_button "Add To Cart"
    URI.parse(current_url).path.should == "/cart"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spree_minicart-1.0.0 spec/requests/minicart_spec.rb
spree_minicart-0.0.4 spec/requests/minicart_spec.rb
spree_minicart-0.0.3 spec/requests/minicart_spec.rb
spree_minicart-0.0.2 spec/requests/minicart_spec.rb
spree_minicart-0.0.1 spec/requests/minicart_spec.rb