Sha256: 668bc30486d178213d25cea1f9da3fecc5342f05f03852f7b6503ca168416845

Contents?: true

Size: 1.93 KB

Versions: 47

Compression:

Stored size: 1.93 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

describe "Store", type: :feature, js: true do
  stub_authorization!

  let!(:store) do
    create(:store, name: 'Test Store', url: 'test.example.org',
           mail_from_address: 'test@example.org')
  end

  let!(:vat_country) { create(:country, iso: "DE", name: "Germany") }

  before(:each) do
    visit spree.admin_path
    click_link "Settings"
    within('.admin-nav') do
      click_link "Stores"
    end
  end

  context "visiting general store settings" do
    it "should have the right content" do
      expect(page).to have_field("store_name", with: "Test Store")
      expect(page).to have_field("store_url", with: "test.example.org")
      expect(page).to have_field("store_mail_from_address", with: "test@example.org")
    end
  end

  context "editing general store settings" do
    it "should be able to update the site name" do
      fill_in "store_name", with: "Spree Demo Site99"
      fill_in "store_mail_from_address", with: "spree@example.org"
      click_button "Update"

      expect(page).to have_content "successfully updated"
      expect(page).to have_field("store_name", with: "Spree Demo Site99")
      expect(page).to have_field("store_mail_from_address", with: "spree@example.org")
    end

    it "should be able to update the default cart tax country" do
      expect(page).to have_select('Tax Country for Empty Carts', selected: 'No taxes on carts without address')

      select "Germany", from: "Tax Country for Empty Carts"
      click_button "Update"

      expect(page).to have_content("has been successfully updated")
      expect(page).to have_select("Tax Country for Empty Carts", selected: "Germany")
    end
  end

  context "update fails" do
    it "should display the error" do
      fill_in "Site Name", with: " "
      click_button "Update"

      expect(page).to have_content("can't be blank")
      expect(page).to have_field("Site Name", with: " ")
    end
  end
end

Version data entries

47 entries across 47 versions & 2 rubygems

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