Sha256: ba6c354e95d3379a13cf830871c81aecc9e7f6dd054752a839e86a16f2b5e698

Contents?: true

Size: 731 Bytes

Versions: 5

Compression:

Stored size: 731 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

feature "Promotion Codes" do
  stub_authorization!

  describe "create" do
    let(:promotion) { create :promotion }

    before do
      visit spree.new_admin_promotion_promotion_code_path(promotion)
    end

    it "creates a new promotion code" do
      fill_in "Value", with: "XYZ"
      click_button "Create"

      expect(page).to have_content "Promotion Code has been successfully created!"
    end

    it "disables the button at submit", :js do
      page.execute_script "$('form').submit(function(e) { e.preventDefault()})"

      fill_in "Value", with: "XYZ"
      click_button "Create"

      expect(page).to have_button("Create", disabled: true)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
solidus_backend-2.10.5 spec/features/admin/promotions/promotion_code_spec.rb
solidus_backend-2.10.3 spec/features/admin/promotions/promotion_code_spec.rb
solidus_backend-2.10.2 spec/features/admin/promotions/promotion_code_spec.rb
solidus_backend-2.10.1 spec/features/admin/promotions/promotion_code_spec.rb
solidus_backend-2.10.0 spec/features/admin/promotions/promotion_code_spec.rb