From 6772c66e836a01c04d09e46617b01440adddee74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Strzebi=C5=84czyk?= Date: Mon, 13 May 2024 14:34:48 +0200 Subject: [PATCH] Update spec/granite/form/model/attributes/attribute_spec.rb Co-authored-by: Ilya Denisov --- spec/granite/form/model/attributes/attribute_spec.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spec/granite/form/model/attributes/attribute_spec.rb b/spec/granite/form/model/attributes/attribute_spec.rb index 0a17f67..86cc21f 100644 --- a/spec/granite/form/model/attributes/attribute_spec.rb +++ b/spec/granite/form/model/attributes/attribute_spec.rb @@ -12,9 +12,8 @@ def attribute(*args) describe '#read' do let(:field) do - attribute(type: String, normalizer: lambda { |v| - v ? v.strip : v - }, default: :world, enum: %w[hello 42 world]) + normalizer = ->(v) { v ? v.strip : v } + attribute(type: String, normalizer: normalizer, default: :world, enum: %w[hello 42 world]) end specify { expect(field.tap { |r| r.write(nil) }.read).to eq('world') }