From 6969322920ab50fbfcdeebd14ae363fd16019f5c Mon Sep 17 00:00:00 2001 From: Joseph Mastey Date: Sun, 3 Dec 2017 16:34:36 -0600 Subject: [PATCH] feat(tests): fix tests for change in user_id format --- spec/vulnerabilities/insecure_dor_spec.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/vulnerabilities/insecure_dor_spec.rb b/spec/vulnerabilities/insecure_dor_spec.rb index 559d86c..f64c80b 100644 --- a/spec/vulnerabilities/insecure_dor_spec.rb +++ b/spec/vulnerabilities/insecure_dor_spec.rb @@ -23,11 +23,12 @@ feature "insecure direct object reference" do scenario "attack two\nTutorial: https://github.com/OWASP/railsgoat/wiki/A4-Insecure-Direct-Object-Reference" do login(@normal_user) - expect(@normal_user.id).not_to eq(2) - visit '/users/2/work_info' + another_user = User.find(2) + + visit "/users/#{another_user.id}/work_info" pending if verifying_fixed? - expect(first("td").text).to eq("Joseph Mastey") + expect(first('td').text).to eq(another_user.full_name) end end