Class: TestingNote

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/testing_note.rb

Constant Summary collapse

VERDICTS =
%w{works fails badticket none}

Instance Method Summary collapse

Instance Method Details

#fail?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'app/models/testing_note.rb', line 37

def fail?
  verdict == "fails"
end

#first_fail?Boolean

Returns:

  • (Boolean)


41
42
43
44
45
# File 'app/models/testing_note.rb', line 41

def first_fail?
  return false unless fail?
  first_fail = ticket.testing_notes_since_last_release.where(verdict: "fails").order("created_at ASC").first
  first_fail == nil || first_fail.id == self.id
end

#pass?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'app/models/testing_note.rb', line 33

def pass?
  verdict == "works"
end

#to_commentObject



24
25
26
27
28
29
# File 'app/models/testing_note.rb', line 24

def to_comment
  TicketComment.new(
    user: user,
    body: "**#{verdict}** #{comment}",
    remote_id: remote_id )
end