
单元测试
冰凌花花
欢迎来到我的博客, 本人乃互联网行业一枚小小的螺丝钉—非典型程序员妹子.
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Rails Rspec 单元测试 验证接口 返回格式 所有字段
如何在单元测试中测试接口返回的字段? 如果我们有一个api的entity为 employment.rb # frozen_string_literal: true module API::Entities::BorrowerEntities class Employment < API::Entity param :in_type_id, safe_path: %i[p...原创 2019-10-16 06:05:56 · 261 阅读 · 0 评论 -
undefined method `validate_presence_of'
https://github.com/thoughtbot/shoulda-matchers 加了gem 'shoulda-matchers', '~> 3.0', 报错是因为没有配置spec/rails_helper.rb,详细内容在上面连接里的configuration里 Shoulda::Matchers.configure do |config| confi原创 2015-10-21 18:55:25 · 757 阅读 · 0 评论 -
grape api单元测试
推荐两个网址: https://github.com/rspec/rspec-rails http://rspec.info/documentation/ 上传了一个api的单元测试,https://github.com/shiralwz/grape_api_rspec 主要步骤: (1)在Gemfile里加入新gem gem 'rspec-rails', '~原创 2015-10-12 16:14:28 · 756 阅读 · 0 评论