Sha256: 71dcb743e7844e893253e74acbcf365f9984eca7fbea7f4fd723f47e16b01c5b

Contents?: true

Size: 766 Bytes

Versions: 1

Compression:

Stored size: 766 Bytes

Contents

require 'spec_helper'

describe StreetTypeUpdater do
  subject { described_class }

  describe '#update!' do
    before do
      StreetType.destroy_all
    end

    context 'without street type' do
      it 'should create new street type' do
        expect do
          subject.update!
        end.to change(StreetType, :count).by(290)
      end
    end

    context 'with street type' do
      let!(:street_type) do
        StreetType.new(code: '7', name: 'Atalh').tap do |record|
          record.save(validate: false)
        end
      end

      it 'should update the street types' do
        expect(street_type.name).to eq 'Atalh'

        subject.update!

        street_type.reload

        expect(street_type.name).to eq 'Atalho'
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
unico-training-7.8.0 spec/lib/street_type_updater_spec.rb