From a8573febaa8b28c495a88d5d396d169e247ba120 Mon Sep 17 00:00:00 2001 From: mfo Date: Fri, 5 Jul 2024 09:34:26 +0200 Subject: [PATCH] clean(spec): remove since its now forced by a before_validation --- ...ix_decimal_number_with_spaces_task_spec.rb | 42 ------------------- 1 file changed, 42 deletions(-) delete mode 100644 spec/tasks/maintenance/fix_decimal_number_with_spaces_task_spec.rb diff --git a/spec/tasks/maintenance/fix_decimal_number_with_spaces_task_spec.rb b/spec/tasks/maintenance/fix_decimal_number_with_spaces_task_spec.rb deleted file mode 100644 index 1e257144f..000000000 --- a/spec/tasks/maintenance/fix_decimal_number_with_spaces_task_spec.rb +++ /dev/null @@ -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