Sha256: 9001af08947d89055f74d6a092acd2d1ba0af61470b566310c417daac8aa8253

Contents?: true

Size: 1.29 KB

Versions: 47

Compression:

Stored size: 1.29 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

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

  before(:each) do
    create(:country)
    visit spree.admin_path
    click_link "Settings"
    click_link "Shipping"
    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
    create(:stock_location)
    visit current_path

    expect(find('#listing_stock_locations')).to have_content("NY Warehouse")
    accept_alert do
      click_icon :trash
    end

    expect(page).to have_content('Stock Location "NY Warehouse" has been successfully removed')

    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

47 entries across 47 versions & 2 rubygems

Version Path
solidus_backend-2.10.5 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-2.10.3 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-2.10.2 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-2.9.6 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-2.8.6 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-2.10.1 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-2.9.5 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-2.10.0 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-2.9.4 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-2.6.6 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-2.7.4 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-2.8.5 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-2.9.3 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-2.9.2 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-2.10.0.beta1 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-2.7.3 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-2.6.5 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-2.9.1 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-2.9.0 spec/features/admin/configuration/stock_locations_spec.rb
solidus_backend-2.9.0.rc.1 spec/features/admin/configuration/stock_locations_spec.rb