require 'minitest/autorun' require_relative './common_setup_and_teardown.rb' class BulkScheduledDatesTest < Minitest::Test include CommonSetupAndTeardown def setup super('scheduled_dates') end def test_calc_scheduled_dates input_scheduled_dates = [ { target_date: '2019-01-02', sight: '1m10', closing_day: '5', shift: 'before' }, { target_date: nil, sight: '1m10', closing_day: '5', shift: 'before' } ] response = @api.bulk_scheduled_date(input_scheduled_dates) assert_equal '200', response[:status] assert_equal '2019-01-10', response[:json][0][:scheduled_date] assert_equal '200', response[:json][0][:status] assert_equal '422', response[:json][1][:status] assert_equal 'target date is required', respoonse[:json][1][:error] end end