Tag: 水豚

我怎样才能检查一个表单域使用水豚正确预填?

我有一个适当的标签,我可以用水豚填写没有问题的领域: fill_in 'Your name', with: 'John' 我想在填写之前检查它的价值,并不能弄清楚。 如果我在fill_in之后添加以下行: find_field('Your name').should have_content('John') 该testing失败,虽然之前填写工作,因为我通过保存页面validation。 我错过了什么?

如何使用Capybara查询string获取当前path

这个页面的URL类似于/people?search=name而我使用的是水豚的current_path方法,它只返回/people 。 current_path.should == people_path(:search => 'name') 但它没有说 expected: "/people?search=name" got: "/people" 我们如何能通过? 有没有办法做到这一点?

如何testing与黄瓜确认对话框?

我正在使用Ruby on Rails与黄瓜和水豚。 我将如何去testing一个简单的确认命令(“你确定吗?”)? 另外,我在哪里可以find关于这个问题的进一步文件?

我如何用Capybara 2.0testing页面标题?

尝试使用以下命令testing包含<title>My Title</title>的页面: # spec/features/reports_spec.rb require 'spec_helper' feature "Archive Management" do subject { page } describe "Index Page" do before(:all) { 10.times { FactoryGirl.create(:randomreport) } } after(:all) { Report.delete_all } describe "when no search terms present" do before { visit reports_path } it { should have_selector('title', text: 'My Title') } # <= Fails w/Capybara 2.0 it […]