0
我是新的导轨。我使用copybara gem来测试设计。下面是测试代码水豚导轨测试错误
require 'test_helper'
class UserTasksTest < ActionDispatch::IntegrationTest
test 'Should create a new user' do
visit root_url
click_link 'Sign up'
fill_in "Email", with: '[email protected]'
fill_in "Password", with: 'capybara'
fill_in "Password confirmation", with: 'capybara'
click_button 'Sign up'
within("h1") do
assert has_content?(user.email)
end
end
end
运行测试我有一个错误后:
undefined local variable or method `user'
应该如何我正确地写测试?
谢谢,真的对我有帮助:) –