【发布时间】:2019-03-05 14:04:30
【问题描述】:
我使用 cypress 为 POST 方法编写了一个测试用例,并且我有一个 datetime 变量,如果我像 datetime 一样传递并且它以 0 开头,它会给我 Legacy octal literals are not allowed 编译错误。
这是测试脚本
describe('Create New Patient', function(){
it('Creates new patient', function(){
cy
.request('POST', 'http://localhost:5002/api/v1/patients', { first_name: 'Jane', last_name: 'Dane', date_of_birth: 03041990 })
.then((response) => {
expect(response.body).to.have.property('first_name', 'Jane') // true
expect(response.status).to.eq(200)
})
})
})
【问题讨论】:
标签: ruby-on-rails api cypress octal web-api-testing