Sha256: 54463865ef365e45606d2a4b1cd1cd79b70eb7513d363587eecdc0a9a0c2038b

Contents?: true

Size: 1.07 KB

Versions: 2

Compression:

Stored size: 1.07 KB

Contents

require 'spec_helper'

RSpec.feature 'Managing volume price models' do
  stub_authorization!

  scenario 'a admin can create and remove volume price models', :js do
    visit spree.admin_volume_price_models_path
    expect(page).to have_content('Volume Price Models')

    click_on 'New Volume Price Model'
    fill_in 'Name', with: 'Discount'
    within '#volume_prices' do
      fill_in 'volume_price_model_volume_prices_attributes_0_name', with: '5 pieces discount'
      select 'Total price', from: 'volume_price_model_volume_prices_attributes_0_discount_type'
      fill_in 'volume_price_model_volume_prices_attributes_0_range', with: '1..5'
      fill_in 'volume_price_model_volume_prices_attributes_0_amount', with: '1'
    end
    click_on 'Create'

    within 'tr.volume_price.fields' do
      expect(page).to have_field('volume_price_model_volume_prices_attributes_0_name', with: '5 pieces discount')
      page.find('a[data-action="remove"]').click
      expect(page).to_not have_field('volume_price_model_volume_prices_attributes_0_name', with: '5 pieces discount')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
solidus_volume_pricing-0.2.1 spec/features/manage_volume_price_models_feature_spec.rb
solidus_volume_pricing-0.1.1 spec/features/manage_volume_price_models_feature_spec.rb