0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

to respond to `has_tag?

Last updated at Posted at 2025-02-03
Failure/Error: expect(@response.body).to have_tag(:div)
       expected "<!DOCTYPE html>\n<html>\n<head>\n.....</html>\n" to respond to `has_tag?

下のドキュメントを読んで実行したが失敗し続けた。

解決

上の記事で解決できた。
rspec-html-matchersをインストールが必要だった。configも設定する

gem 'rspec-html-matchers'

このメソッドがどこのライブラリにあることを意識する必要があった

Ruby のライブラリは主に RubyGems.org に gem として置かれています。

Libraries » rspec-html-matchers (0.10.0) » Index (R) » RSpecHtmlMatchers
Module: RSpecHtmlMatchers
Defined in:
lib/rspec-html-matchers.rb

have_tagメソッドの説明

0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?