这是一个不错的方式吗?最好匹配正则表达式。
我目前的代码是这样的:
describe "get #show" do
context "signed in" do
it "should have a link to edit profile" do
# i sign in the user
get :show
response # i don't know what to do here
end
end
end
感谢您的帮助!
答案 0 :(得分:1)
您似乎正在尝试acceptance test,这可能意味着您应该遵从Capybara。然后你可以像
一样做魔术 page.should have_css('edit_link', text: 'Edit me')