Skip to content

Commit

Permalink
Return a list of all open tickets that are to be reviewed.
Browse files Browse the repository at this point in the history
  • Loading branch information
alloy committed Dec 3, 2010
1 parent 9bf8ef2 commit 29cd120
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/macruby_bugmash_bot/trac.rb
Expand Up @@ -41,6 +41,16 @@ def user(name)
end
end

def marked_for_review
result = []
@active_tickets.each { |id, t| result << id if t[:marked_for_review] }
if result.empty?
["There are currently no open tickets marked for review."]
else
result.sort.map { |id| ticket_message(id) }
end
end

# Returns a ticket that nobody is working on yet, in ascending order.
def open_ticket
ot = nil
Expand Down
8 changes: 8 additions & 0 deletions spec/trac_spec.rb
Expand Up @@ -121,5 +121,13 @@ def self.raw_active_tickets_feed
end

it "returns a list of tickets that are marked for review" do
@trac.marked_for_review.should == ["There are currently no open tickets marked for review."]
@trac.assign_ticket(81, "alloy")
@trac.mark_for_review(81, "alloy")
@trac.assign_ticket(47, "lrz")
@trac.mark_for_review(47, "lrz")
@trac.assign_ticket(19, "alloy")
@trac.mark_for_review(19, "alloy")
@trac.marked_for_review.should == ["#19: Problems with method_missing (http://www.macruby.org/trac/ticket/19)", "#47: Cannot pass a :symbol directly as a named parameter (http://www.macruby.org/trac/ticket/47)", "#81: Enumerable::Enumerator seems to be broken (http://www.macruby.org/trac/ticket/81)"]
end
end

0 comments on commit 29cd120

Please sign in to comment.