Class: Lazylead::Wiki

Inherits:
Requirement show all
Defined in:
lib/lazylead/task/accuracy/wiki.rb

Overview

Check that ticket has a remote link to external system with relationship

type = "Wiki Page".

Instance Attribute Summary

Attributes inherited from Requirement

#desc, #field, #score

Instance Method Summary collapse

Methods inherited from Requirement

#blank?, #non_blank?

Constructor Details

#initialize(score = 2, relationship = "Wiki Page") ⇒ Wiki

Returns a new instance of Wiki.



31
32
33
34
# File 'lib/lazylead/task/accuracy/wiki.rb', line 31

def initialize(score = 2, relationship = "Wiki Page")
  super "Reference to design specification", score, "Ticket Links (Wiki)"
  @relationship = relationship
end

Instance Method Details

#passed(issue) ⇒ Object



36
37
38
39
# File 'lib/lazylead/task/accuracy/wiki.rb', line 36

def passed(issue)
  return false if issue.remote_links.nil? || issue.remote_links.empty?
  issue.remote_links.any? { |l| @relationship.eql? l.attrs["relationship"] }
end