Я использую rspec, огурец и capybara, и я ищу способ проверить, что злоумышленник не может взломать форму, а затем отправить URL-адрес, на который у него нет разрешения. У меня есть мои разрешения, установленные в cancan, так что это "должно" работать, однако, единственный способ проверить это - взломать форму самостоятельно.
Как я могу автоматизировать такое тестирование? С webrat я мог бы сделать это в unit test с rspec с чем-то вроде
put :update, :user_id => @user.id, :id => @user_achievement.id
response.should contain("Error, you don't have permission to access that!")
В capybara, однако, посещение только кажется, кажется. Я не могу найти способ сделать это, я googled везде.
Любая помощь будет высоко оценена, Благодаря