diff --git a/Gemfile b/Gemfile index 43a67db..38877ce 100644 --- a/Gemfile +++ b/Gemfile @@ -1,12 +1,16 @@ source 'https://rubygems.org' gemspec - unless ENV['TRAVIS'] gem 'byebug', require: false, platforms: :mri gem 'yard', require: false end +# This is required until dry-validation 0.8 will be out +gem 'dry-types', require: false, github: 'dry-rb/dry-types' +gem 'dry-logic', require: false, github: 'dry-rb/dry-logic' +gem 'dry-validation', require: false, github: 'dry-rb/dry-validation' + gem 'hanami-utils', '~> 0.8', github: 'hanami/utils', branch: '0.8.x' gem 'hanami-validations', '~> 0.6', github: 'hanami/validations', branch: '0.6.x' gem 'hanami-controller', '~> 0.7', github: 'hanami/controller', branch: '0.7.x' diff --git a/test/fixtures.rb b/test/fixtures.rb index 822b6f9..3ef4229 100644 --- a/test/fixtures.rb +++ b/test/fixtures.rb @@ -305,7 +305,7 @@ class FormHelperView attr_reader :params def initialize(params) - @params = Hanami::Action::Params.new(params) + @params = Hanami::Action::BaseParams.new(params) end end @@ -339,10 +339,12 @@ def initialize(attributes = {}) end class DeliveryParams < Hanami::Action::Params - param :delivery do - param :customer_id, type: Integer, presence: true - param :address do - param :street, type: String, presence: true + params do + required(:delivery).schema do + required(:customer_id, :int).filled + required(:address).schema do + required(:street, :string).filled + end end end end diff --git a/test/integration/form_helper_test.rb b/test/integration/form_helper_test.rb index e507492..ccc1eb7 100644 --- a/test/integration/form_helper_test.rb +++ b/test/integration/form_helper_test.rb @@ -7,7 +7,7 @@ describe 'form with huge ERB block' do before do - @params = Hanami::Action::Params.new({}) + @params = Hanami::Action::BaseParams.new({}) @session = Session.new(_csrf_token: 'l23') @actual = FullStack::Views::Sessions::New.render(format: :html, params: @params, session: @session) end