XSS Capybara spec added.
This commit is contained in:
@@ -3,21 +3,12 @@ require 'tmpdir'
|
||||
|
||||
feature 'command injection' do
|
||||
before do
|
||||
User.delete_all
|
||||
Rails.application.load_seed
|
||||
@normal_user = User.new(:first_name => 'Joe', :last_name => 'Schmoe',
|
||||
:email => 'joe@schmoe.com', :password => 'aoeuaoeu', :password_confirmation => 'aoeuaoeu')
|
||||
@normal_user.build_benefits_data
|
||||
@normal_user.save!
|
||||
UserFixture.reset_all_users
|
||||
@normal_user = UserFixture.normal_user
|
||||
end
|
||||
|
||||
scenario 'injection attack on file upload', :js => true do
|
||||
visit '/'
|
||||
within('.signup') do
|
||||
fill_in 'email', :with => 'joe@schmoe.com'
|
||||
fill_in 'password', :with => 'aoeuaoeu'
|
||||
end
|
||||
click_on 'Login'
|
||||
login(@normal_user)
|
||||
|
||||
legit_file = File.join(Rails.root, 'public', 'data', 'legit.txt')
|
||||
File.open(legit_file, 'w') { |f| f.puts 'totes legit' }
|
||||
|
||||
Reference in New Issue
Block a user