我有这个<p>
带有下一个内容的标签:
<p id="post_example"> <%= t (".for_example_type") %> <strong><%= post.title %></strong></p>
在我的集成测试中:
it "should have example post" do
should have_selector "#post_example", :text => "For example, type #{post.title}"
end
1) Index page should have example post
Failure/Error: should have_selector "#post_example", :text => "For example, type #{post.title}"
expected #has_selector?("#post_example", {:text=>"For example, type Post number 10"}) to return true, got false
# ./spec/requests/posts_spec.rb:26:in `block (3 levels) in <top (required)>'
Finished in 3.8 seconds
6 examples, 1 failure
Failed examples:
rspec ./spec/requests/posts_spec.rb:25 # Index page should have example post
Randomized with seed 5480
:text
是否可以将红宝石代码和文本/字符串的混合传递给水豚?