English 中文(简体)
Capybara and Railways, 为什么有联系? 返回总是虚假的?
原标题:Capybara and Rails, Why has_link? always returns false?

我试图用“联系”来测试? 在我的试想中,我在此检验:

page.has_link?( next_page , {}).should == true

but, the test always fail, although the link with id next_page dose exist! the strange thing is that have_content always works fine, here is how I implement it:

page.should have_content("some text")

您能否帮助我? 我在这里失踪了吗?

http://www.ohchr.org。

页: 1

<a id="next_page" href="javascript: void(0)" onclick="javascript: void(0)" style="color: #888888">Next</a>
最佳回答

我认为,你应当:

页: 1 “一页”

页: 1 “一页”, url_path

问题回答

你可以尝试以下样本:

it "should have logout link" do
  expect(page).to have_link( Logout ) 
end 

我这样做是为了:

rendered.should have_link("Teams", :href => teams_path)




相关问题
How to use rspec to test named routes?

Given I have a named route: map.some_route /some_routes/:id , :controller => some , :action => other How do I use the routing spec file spec/routing/some_routing_spec.rb to test for that ...

Silencing Factory Girl logging

Just to clear the air, I am not some cruel factory master trying to silence working ladies. I am having a very annoying problem where when using Thoughtbot s factory girl in my specs, every time ...

Controller specs in isolation mode and render :update

I am using RSpec for writing my controller tests/specs. I faced the problem, that the following code gets rendered: render :update do |page| page[ middle_content ].replace_html :partial => "...

rspec testing views with internationalization?

I want to make sure I have the right meta desc/keyword and title text in my view so I want to create rspec views tests for that. Now the real challange here is how to make it work across multiple ...

热门标签