Sha256: cf6e309f9cc50b1a259301148299d4b50f9360ca7aefb2e750b6da5942fa5c10

Contents?: true

Size: 851 Bytes

Versions: 4

Compression:

Stored size: 851 Bytes

Contents

RSpec.describe Spree::Admin::VariantsController, type: :controller do
  stub_authorization!

  context 'PUT #update' do
    it 'creates a volume price' do
      variant = create :variant

      expect do
        spree_put :update,
                  product_id: variant.product.slug,
                  id: variant.id,
                  variant: {
                    'volume_prices_attributes' => {
                      '1335830259720' => {
                        'name' => '5-10',
                        'discount_type' => 'price',
                        'range' => '5..10',
                        'amount' => '90',
                        'position' => '1',
                        '_destroy' => 'false'
                      }
                    }
                  }
      end.to change(variant.volume_prices, :count).by(1)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
solidus_volume_pricing-0.2.1 spec/controllers/spree/admin/variants_controller_spec.rb
solidus_volume_pricing-0.1.1 spec/controllers/spree/admin/variants_controller_spec.rb
solidus_volume_pricing-0.2.0 spec/controllers/spree/admin/variants_controller_spec.rb
solidus_volume_pricing-0.1.0 spec/controllers/spree/admin/variants_controller_spec.rb