Skip to content

Commit 9af3e1d

Browse files
committedApr 4, 2017
added new test to ensure that folder names do not trigger false positives
1 parent e399a0c commit 9af3e1d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎spec/unit_tests/job_spec.rb

+8
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,14 @@ def builder = new groovy.json.JsonBuilder(allInfo)
328328
@client.should_receive(:api_post_request).with('/scriptText', {'script' => script_text}, true).and_return(FakeResponse.new(200,mock_job_list_response))
329329
@job.exists?(job_name).should == true
330330
end
331+
332+
it "does not match folder names" do
333+
job_name = 'test_job'
334+
mock_job_list_response = { "jobs" => [ { "_class": "com.cloudbees.hudson.plugins.folder.Folder", "name": job_name,"url": "https://jenkins.example.com/job/#{job_name}/"} ] }
335+
@client.should_receive(:api_post_request).with('/scriptText', {'script' => script_text}, true).and_return(FakeResponse.new(200,mock_job_list_response))
336+
337+
@job.exists?(job_name).should == false
338+
end
331339
end
332340

333341
describe "#list_by_status" do

0 commit comments

Comments
 (0)