def get_action_comments(controller, action)
      lines = File.readlines(File.join(ReqresRspec.root, 'app', 'controllers', "#{controller}_controller.rb"))

      action_line = nil
      lines.each_with_index do |line, index|
        if line.match(/\s*def #{action}/) #  def show
          action_line = index
          break
        end
      end

      if action_line
        comment_lines = []
        was_comment = true
        while action_line > 0 && was_comment
          action_line -= 1

          if lines[action_line].match(/\s*#/)
            comment_lines << lines[action_line].strip
          else
            was_comment = false
          end
        end

        comment_lines.reverse
      else
        ['not found']
      end
    rescue Errno::ENOENT
      ['not found']
    end
def get_action_comments(controller, action)
      lines = File.readlines(File.join(ReqresRspec.root, 'app', 'controllers', "#{controller}_controller.rb"))

      action_line = nil
      lines.each_with_index do |line, index|
        if line.match(/\s*def #{action}/) #  def show
          action_line = index
          break
        end
      end

      if action_line
        comment_lines = []
        was_comment = true
        while action_line > 0 && was_comment
          action_line -= 1

          if lines[action_line].match(/\s*#/)
            comment_lines << lines[action_line].strip
          else
            was_comment = false
          end
        end

        comment_lines.reverse
      else
        ['not found']
      end
    rescue Errno::ENOENT
      ['not found']
    end
returns action comments taken from controller file
 example TODO