minitestのintegration
テストを使って以下のような複数クラスのテストする。
1
2
3
|
<div class="notification is-danger">
<p>test</p>
</div>
|
最初は以下のように書いてしまったが、テストが通らない。
1
2
3
|
test "複数クラスのテスト" do
assert_select 'div.notification is-danger'
end
|
正しくは、do
で囲む。
1
2
3
4
5
|
test "複数クラスのテスト" do
assert_select 'div.notification' do
assert_select 'div.is-danger'
end
end
|
See Also