spec/arachni/issue_spec.rb in arachni-1.4 vs spec/arachni/issue_spec.rb in arachni-1.5
- old
+ new
@@ -24,10 +24,29 @@
it 'recodes string data to UTF8' do
expect(issue.name).to eq("Check name \u2713")
end
+ it 'is comparable' do
+ informational = issue.dup.tap { |i| i.severity = Arachni::Issue::Severity::INFORMATIONAL }
+ low = issue.dup.tap { |i| i.severity = Arachni::Issue::Severity::LOW }
+ medium = issue.dup.tap { |i| i.severity = Arachni::Issue::Severity::MEDIUM }
+ high = issue.dup.tap { |i| i.severity = Arachni::Issue::Severity::HIGH }
+
+ expect(informational).to be < low
+ expect(low).to be < medium
+ expect(medium).to be < high
+
+ expect(high).to be > medium
+ expect(medium).to be > low
+ expect(low).to be > informational
+
+ expect([low, informational, high, medium].sort).to eq(
+ [informational, low, medium, high]
+ )
+ end
+
describe '#recheck' do
it 'rechecks the issue' do
Arachni::Options.paths.checks = fixtures_path + '/signature_check/'
Arachni::Options.audit.elements :links, :forms, :cookies
@@ -411,10 +430,10 @@
expect(i.unique_id).to eq(
"#{i.name}:#{i.vector.method}:#{i.vector.affected_input_name}:#{i.vector.url}"
)
i = passive_issue
- expect(i.unique_id).to eq("#{i.name}:#{i.proof}:#{i.vector.url}")
+ expect(i.unique_id).to eq("#{i.name}:#{i.proof}:#{i.vector.affected_input_name}:#{i.vector.url}")
end
end
describe '#eql?' do
context 'when 2 issues are equal' do