Sha256: 0f1dbfd52c8f383242cce81362e04b7b5210b7300c2a4a0bb10cb75f14a3d279

Contents?: true

Size: 1.52 KB

Versions: 16

Compression:

Stored size: 1.52 KB

Contents

require 'spec_helper'

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

  before(:each) do
    visit spree.admin_path
    click_link "Configuration"
  end

  context "admin visiting store credit categories list" do
    it "should display existing store credit categories" do
      create(:store_credit_category)
      click_link "Store Credit Categories"

      within_row(1) { expect(page).to have_content("Exchange") }
    end
  end

  context "admin creating a new store credit category" do
    before(:each) do
      click_link "Store Credit Categories"
      click_link "admin_new_store_credit_category_link"
    end

    it "should be able to create a new store credit category" do
      expect(page).to have_content("New Store Credit Category")
      fill_in "store_credit_category_name", with: "Return"
      click_button "Create"
      expect(page).to have_content("successfully created!")
    end

    it "should show validation errors if there are any" do
      click_button "Create"
      expect(page).to have_content("Name can't be blank")
    end
  end

  context "admin editing a store credit category" do
    it "should be able to update an existing store credit category" do
      create(:store_credit_category)
      click_link "Store Credit Categories"
      within_row(1) { click_icon :edit }
      fill_in "store_credit_category_name", with: "Return"
      click_button "Update"
      expect(page).to have_content("successfully updated!")
      expect(page).to have_content("Return")
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

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