0

什么是体面的做法?最好匹配一个正则表达式。

我当前的代码是这样的:

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

谢谢您的帮助!

4

1 回答 1

1

似乎您正在尝试进行验收测试,这可能意味着您应该遵从Capybara。然后你可以做魔术

page.should have_css('edit_link', text: 'Edit me')

于 2012-08-29T01:23:56.197 回答