Mass assignment spec added

This commit is contained in:
chrismo
2013-10-01 17:14:21 -05:00
parent 85b0c7608b
commit b1a3882496
2 changed files with 23 additions and 0 deletions
+1
View File
@@ -1 +1,2 @@
--color
--backtrace
+22
View File
@@ -0,0 +1,22 @@
require 'spec_helper'
feature 'sql injection' do
before do
UserFixture.reset_all_users
@normal_user = UserFixture.normal_user
end
scenario 'mass assignment attack on account_settings' do
@normal_user.admin.should be_false
login(@normal_user)
params = {:user => {:admin => 't',
:user_id => @normal_user.user_id,
:password => @normal_user.clear_password,
:password_confirmation => @normal_user.clear_password}}
page.driver.put "/users/#{@normal_user.user_id}.json", params
@normal_user.reload.admin.should be_true
end
end