我使用的设计和写作删除自己的帐号的用户的情况下测试,但我卡在我将如何调出确认框,然后单击确定。
这里是链接和我的测试:
<p><%= link_to "Delete my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete %></p>
规格/请求/ users_spec.rb
scenario 'user deletes account' do
make_user_and_login
click_link('Account Settings')
page.should have_selector('title', :text => 'Account Settings')
click_link('Delete my account')
# Are You Sure?
# click OK in confirm box
# page.should etc.....
end
这将如何做呢?