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'
應該如何我正確地寫測試?
謝謝,真的對我有幫助:) –