clean(spec): remove since its now forced by a before_validation

This commit is contained in:
mfo 2024-07-05 09:34:26 +02:00
parent c50f949acd
commit a8573febaa
No known key found for this signature in database
GPG key ID: 7CE3E1F5B794A8EC

View file

@ -1,42 +0,0 @@
# frozen_string_literal: true
require "rails_helper"
module Maintenance
RSpec.describe FixDecimalNumberWithSpacesTask do
describe "#process" do
subject(:process) { described_class.process(element) }
let(:champ) { create(:champ_decimal_number, value:) }
let(:element) { champ }
context 'with nil' do
let(:value) { 0 }
it { expect { process }.not_to change { champ.reload.valid_value } }
end
context 'with simple number' do
let(:value) { "120" }
it { expect { process }.not_to change { champ.reload.valid_value } }
end
context 'with number having leading spaces' do
let(:value) { " 120" }
it { expect { process }.to change { champ.reload.valid_value }.from(nil).to("120") }
end
context 'with number having trailing spaces' do
let(:value) { "120 " }
it { expect { process }.to change { champ.reload.valid_value }.from(nil).to("120") }
end
context 'with number having leading and trailing spaces' do
let(:value) { " 120 " }
it { expect { process }.to change { champ.reload.valid_value }.from(nil).to("120") }
end
context 'with number having in between spaces' do
let(:value) { "1 2 0" }
it { expect { process }.to change { champ.reload.valid_value }.from(nil).to("120") }
end
context 'with number having in between tab' do
let(:value) { "\t120\t" }
it { expect { process }.to change { champ.reload.valid_value }.from(nil).to("120") }
end
end
end
end