【发布时间】:2011-10-13 22:40:49
【问题描述】:
require 'test_helper'
class MyTest < ActionController::IntegrationTest
test "view posts from login page" do
visit("/logins/new")
find_field('Username').set('abode')
find_field('Password').set('efghi')
click_link_or_button('Login')
#assert current_path == "/logins/new"
assert current_path == "/posts/index"
end
end
在上面的代码中,第一个断言通过,而第二个断言失败。否则它应该发生。在click_link_or_button('Login') 执行后,我假设的页面登录。我做错了什么?
谢谢!
【问题讨论】:
标签: ruby-on-rails integration-testing capybara