Sha256: 370ec4b15b1f2b7f3ca30b30b944763e69e5607eb0441828eed0bc163bbfd8f7

Contents?: true

Size: 486 Bytes

Versions: 7

Compression:

Stored size: 486 Bytes

Contents

# frozen_string_literal: true

RSpec.describe Macros::VerifyParams::Date do
  subject(:date_step) { described_class.new(params_key: params_key) }

  let(:params_key) { :date }

  let(:date) { Date.parse('2019-01-15') }
  let(:ctx) { { params: { date: date } } }

  it 'expects to pass' do
    expect(date_step.call(ctx)).to be true
  end

  context 'date invalid' do
    let(:date) { '2018' }

    it 'expects to fail' do
      expect(date_step.call(ctx)).to be false
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ff-tbl-macros-2.0.2 spec/lib/verify_params/date_spec.rb
ff-tbl-macros-2.0.1 spec/lib/verify_params/date_spec.rb
ff-tbl-macros-2.0.0 spec/lib/verify_params/date_spec.rb
ff-tbl-macros-1.0.2 spec/lib/verify_params/date_spec.rb
ff-tbl-macros-1.0.1 spec/lib/verify_params/date_spec.rb
ff-tbl-macros-1.0.0 spec/lib/verify_params/date_spec.rb
ff-tbl-macros-0.1.8 spec/lib/verify_params/date_spec.rb