Skip to content

Commit

Permalink
ツイートのrequest specにケース追加
Browse files Browse the repository at this point in the history
  • Loading branch information
KOH6 committed Oct 8, 2023
1 parent 9b52489 commit 72feed2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/requests/posts_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
expect(response).to have_http_status(:ok)
end

it 'ツイートcreateに失敗すること' do
expect do
post posts_path, params: { post: post_params }
end.not_to change(Post, :count)
end

it 'responseにエラー文が含まれること' do
post posts_path, params: { post: post_params }
expect(response.body).to include 'エラーが発生したため 投稿 は保存されませんでした。'
Expand Down

0 comments on commit 72feed2

Please sign in to comment.