spec/models/burndown_spec.rb
# Creates, closes and reopens issues only for odd days numbers
Creates, closes and reopens issues only for odd days numbers
Creates closes and reopens issues only for odd days numbers
def build_sample
    milestone.start_date.upto(milestone.due_date) do |date|
      day = date.day
      next if day.even?
      count = day * 4
      Timecop.travel(date) do
        issues = create_list(:issue, count, issue_params)
        closed = issues.slice(0..count / 2)
        closed.each(&:close)
        closed.slice(0..count / 4).each(&:reopen)
      end
    end
  end
def build_sample milestone . start_date . upto ( milestone . due_date ) do | date | day = date . day next if day . even? count = day * 4 Timecop . travel ( date ) do issues = create_list ( :issue , count , issue_params ) closed = issues . slice ( 0 .. count / 2 ) closed . each ( & :close ) closed . slice ( 0 .. count / 4 ) . each ( & :reopen ) end end end
Creates, closes and reopens issues only for odd days numbers
Creates closes and reopens issues only for odd days numbers
# Create issues # Close issues # Reopen issues