Sha256: 87c2bfde2a922fd5b29a1dc51d580396ff5bd45c7213adf0e7278fe7d014539d

Contents?: true

Size: 707 Bytes

Versions: 17

Compression:

Stored size: 707 Bytes

Contents

require 'spec_helper'
require 'date'

describe 'expect_json_types with date' do
  it 'should verify correct date types' do
    mock_get('date_response')
    get '/date_response'
    expect_json_types(createdAt: :date)
  end

  it 'should verify correct date types with path' do
    mock_get('date_response')
    get '/date_response'
    expect_json_types('createdAt', :date)
  end
end

describe 'expect_json with date' do
  it 'should verify correct date value' do
    mock_get('date_response')
    get '/date_response'
    prev_day = DateTime.new(2014, 10, 19)
    next_day = DateTime.new(2014, 10, 21)
    expect_json(createdAt: date { |value| expect(value).to be_between(prev_day, next_day) })
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
airborne-0.2.11 spec/airborne/expectations/expect_json_types_date_spec.rb
airborne-0.2.10 spec/airborne/expectations/expect_json_types_date_spec.rb
airborne-0.2.9 spec/airborne/expectations/expect_json_types_date_spec.rb
airborne-0.2.8 spec/airborne/expectations/expect_json_types_date_spec.rb
airborne-0.2.7 spec/airborne/expectations/expect_json_types_date_spec.rb
airborne-0.2.6 spec/airborne/expectations/expect_json_types_date_spec.rb
airborne-0.2.5 spec/airborne/expectations/expect_json_types_date_spec.rb
airborne-0.2.4 spec/airborne/expectations/expect_json_types_date_spec.rb
airborne-0.2.3 spec/airborne/expectations/expect_json_types_date_spec.rb
airborne-0.2.2 spec/airborne/expectations/expect_json_types_date_spec.rb
airborne-0.2.1 spec/airborne/expectations/expect_json_types_date_spec.rb
airborne-0.2.0 spec/airborne/expectations/expect_json_types_date_spec.rb
airborne-0.1.20 spec/airborne/expectations/expect_json_types_date_spec.rb
airborne-0.1.19 spec/airborne/expectations/expect_json_types_date_spec.rb
airborne-0.1.18 spec/airborne/expectations/expect_json_types_date_spec.rb
airborne-0.1.17 spec/airborne/expectations/expect_json_types_date_spec.rb
airborne-0.1.16 spec/airborne/expectations/expect_json_types_date_spec.rb