cost 118 ms
Rails 测试使用 rspec、shouda_matcher 和 factory_bot_rails rturns PG::NotNullViolation: ERROR: null value in column - Rails test using rspec, shoulda_matcher and factory_bot_rails rturns PG::NotNullViolation: ERROR: null value in column

我有 2 model:答案和书。 尽管它们非常相似,但所有测试都通过了 Answer,但 Book 的 1 次测试失败模型/answer.rb 模型/book.rb 规格/工厂/answers.rb 规格/工厂/books.rb spect/models/answer_spec.rb spec ...

应该匹配器 - Rspec - 测试控制器对 Json 响应的操作 - FastJSON - Shoulda matchers - Rspec - Test controllers Actions to Json Response - FastJSON

如何使用 shoulda-matchers 测试这些操作,以响应 JSON 成功 200 和失败 422 以及如何使用正常 RSpec 进行测试:如果可以的话,两种情况: 我认为在其存储库中缺少一些关于应该匹配的信息。 如果你能帮助非常感谢。 ...

NoMethodError:在单元测试中使用 shoulda-matchers 时,未定义的方法“belong_to”用于测试 - NoMethodError: undefined method `belong_to' for test when using shoulda-matchers in unit test

我尝试使用 shoulda-matchers 来测试模型之间的关联。 但是,它总是显示错误:TakingTest#test_belongs_to:NoMethodError:未定义的方法belong_to' for #<TakingTest:0x00007fc14b8e64a8> tes ...

Shoulda :: Matchers :: Independent :: DelegateMethodMatcher:未定义方法`allow_nil' - Shoulda::Matchers::Independent::DelegateMethodMatcher: undefined method `allow_nil'

我正在尝试在ruby 2.5.0-p0(x86_64- )的rails(5.0.1)应用程序中使用Shoulda-matchers (3.1.2)和rspec-rails(3.7.2)测试我的Comment模型的委托方法。 linux)并收到此错误: 该代码非常简洁明了,我认为该库而不是 ...


排序:
质量:
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM