Skip to content

Commit

Permalink
Update spec/granite/form/model/attributes/attribute_spec.rb
Browse files Browse the repository at this point in the history
Co-authored-by: Ilya Denisov <[email protected]>
  • Loading branch information
lstrzebinczyk and id-ilych authored May 13, 2024
1 parent 5bf1016 commit 6772c66
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions spec/granite/form/model/attributes/attribute_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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') }
Expand Down

0 comments on commit 6772c66

Please sign in to comment.