LoginSignup
1
0

More than 1 year has passed since last update.

React + Rails + AWS Fargate の構成を実現したい - 05 バックエンドのテスト整備編(RSpec)

Last updated at Posted at 2022-08-27

目次

概要

本記事のゴール

以下を参考にバックエンドのテスト整備を行う。

成果

以下コマンドにより、テストを実行できるようになった。

テストに成功する場合

bundle exec rspec
..

Finished in 0.03596 seconds (files took 2.09 seconds to load)
2 examples, 0 failures

テストに失敗する場合

bundle exec rspec
.F

Failures:

  1) Task#valid? タイトルがnilの場合 is expected to be falsy
     Failure/Error: it { is_expected.to be_falsy }
     
       expected: falsey value
            got: true
     # ./spec/models/task_spec.rb:16:in `block (4 levels) in <top (required)>'

Finished in 0.03577 seconds (files took 0.72953 seconds to load)
2 examples, 1 failure

Failed examples:

rspec ./spec/models/task_spec.rb:16 # Task#valid? タイトルがnilの場合 is expected to be falsy

つまづいた点

特になし。参考記事通りに構築を進めることでテスト環境を整備できた。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0