【发布时间】:2023-03-31 16:50:01
【问题描述】:
我有 rspec/capybara 测试正在测试字符串的期望值,但测试正在替换变量。
yaml 中的刺痛:
title: Sold %{product}
测试中的期望:
expect(page).to have_text(t("sell_successes.show.title"))
结果:
expected to find text "Sold %{product}" in blah blah
什么时候应该寻找:
expected to find text "Sold shoes" in blah blah
【问题讨论】:
标签: ruby-on-rails rspec yaml capybara