Sha256: c18823ab4153a6220090391c47cb1a03bd93c302d10675ab168de8e87b49563b

Contents?: true

Size: 1.22 KB

Versions: 16

Compression:

Stored size: 1.22 KB

Contents

require 'spec_helper'

describe "Stock Locations", :type => :feature do
  stub_authorization!

  before(:each) do
    country = create(:country)
    visit spree.admin_path
    click_link "Settings"
    click_link "Stock Locations"
  end

  it "can create a new stock location" do
    click_link "New Stock Location"
    fill_in "Name", with: "London"
    check "Active"
    click_button "Create"

    expect(page).to have_content("successfully created")
    expect(page).to have_content("London")
  end

  it "can delete an existing stock location", js: true do
    location = create(:stock_location)
    visit current_path

    expect(find('#listing_stock_locations')).to have_content("NY Warehouse")
    accept_alert do
      click_icon :trash
    end
    # Wait for API request to complete.
    wait_for_ajax
    visit current_path 
    expect(page).to have_content("NO STOCK LOCATIONS FOUND")
  end

  it "can update an existing stock location" do
    create(:stock_location)
    visit current_path

    expect(page).to have_content("NY Warehouse")

    click_icon :edit
    fill_in "Name", with: "London"
    click_button "Update"

    expect(page).to have_content("successfully updated")
    expect(page).to have_content("London")
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
solidus_backend-1.2.3 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-1.1.4 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-1.0.7 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-1.0.6 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-1.2.2 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-1.2.1 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-1.1.3 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-1.0.5 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-1.2.0 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-1.2.0.rc2 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-1.0.4 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-1.1.2 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-1.2.0.rc1 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-1.2.0.beta1 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-1.0.3 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-1.1.1 spec/features/admin/configuration/stock_locations_spec.rb