Sha256: 7b8ebffc65dbfde2362ff4d547e8c1fac931a93c58422bc9e17990942fd117a8

Contents?: true

Size: 1.18 KB

Versions: 19

Compression:

Stored size: 1.18 KB

Contents

require 'spec_helper'

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

  before(:each) do
    country = create(:country)
    visit spree.admin_stock_locations_path
  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 :delete
    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", js: true 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

19 entries across 19 versions & 1 rubygems

Version Path
spree_backend-3.3.0.rc1 spec/features/admin/configuration/stock_locations_spec.rb
spree_backend-3.1.5 spec/features/admin/configuration/stock_locations_spec.rb
spree_backend-3.2.1 spec/features/admin/configuration/stock_locations_spec.rb
spree_backend-3.2.0 spec/features/admin/configuration/stock_locations_spec.rb
spree_backend-3.1.4 spec/features/admin/configuration/stock_locations_spec.rb
spree_backend-3.2.0.rc3 spec/features/admin/configuration/stock_locations_spec.rb
spree_backend-3.2.0.rc2 spec/features/admin/configuration/stock_locations_spec.rb
spree_backend-3.2.0.rc1 spec/features/admin/configuration/stock_locations_spec.rb
spree_backend-3.1.3 spec/features/admin/configuration/stock_locations_spec.rb
spree_backend-3.1.2 spec/features/admin/configuration/stock_locations_spec.rb
spree_backend-3.0.10 spec/features/admin/configuration/stock_locations_spec.rb
spree_backend-3.1.1 spec/features/admin/configuration/stock_locations_spec.rb
spree_backend-3.1.0 spec/features/admin/configuration/stock_locations_spec.rb
spree_backend-3.1.0.rc4 spec/features/admin/configuration/stock_locations_spec.rb
spree_backend-3.0.9 spec/features/admin/configuration/stock_locations_spec.rb
spree_backend-3.1.0.rc3 spec/features/admin/configuration/stock_locations_spec.rb
spree_backend-3.1.0.rc2 spec/features/admin/configuration/stock_locations_spec.rb
spree_backend-3.1.0.rc1 spec/features/admin/configuration/stock_locations_spec.rb
spree_backend-3.0.8 spec/features/admin/configuration/stock_locations_spec.rb