Sha256: 3f229684dd4c105ff02a8652def12ae4ee4f2d7a15b9d7521de2d5e02de2315e

Contents?: true

Size: 1.13 KB

Versions: 4

Compression:

Stored size: 1.13 KB

Contents

require 'spec_helper'

describe Spree::Admin::AvalaraEntityUseCodesController do
  let(:avalara_entity_use_code) { FactoryGirl.create(:avalara_entity_use_code) }

  stub_authorization!

  before :each do
    DatabaseCleaner.clean
  end

  describe '#index' do
    subject { get :index }

    it { is_expected.to be_success }
  end

  describe '#show' do
    subject { get :show, params: { id: avalara_entity_use_code.id } }

    it { is_expected.to be_success }
  end

  describe '#new' do
    subject { get :new }

    it { is_expected.to be_success }
  end

  describe '#edit' do
    subject { get :edit, params: { id: avalara_entity_use_code.id} }

    it { is_expected.to be_success }
  end

  describe '#update' do
    let(:params) do
      {
        id: avalara_entity_use_code.to_param,
        avalara_entity_use_code: {
          use_code: '55',
        }
      }
    end
    subject { put :update, params: params }

    it { is_expected.to redirect_to(spree.admin_avalara_entity_use_codes_path) }

    it 'should update use_code' do
      expect{subject}.to change { avalara_entity_use_code.reload.use_code }.from('A').to('55')
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
solidus_avatax_certified-3.0.0 spec/controllers/spree/admin/avalara_entity_use_codes_controller_spec.rb
solidus_avatax_certified-2.0.0 spec/controllers/spree/admin/avalara_entity_use_codes_controller_spec.rb
solidus_avatax_certified-1.1.0 spec/controllers/spree/admin/avalara_entity_use_codes_controller_spec.rb
solidus_avatax_certified-1.0.0 spec/controllers/spree/admin/avalara_entity_use_codes_controller_spec.rb