<commit_before>require 'spec_helper'

describe JIRA::Resource::Comment do

  with_each_client do |site_url, client|
    let(:client) { client }
    let(:site_url) { site_url }

    let(:key) { "10000" }

    let(:target) { JIRA::Resource::Comment.new(client, :attrs => {'id' => '99999'}, :issue_id => '54321') }

    let(:expected_collection_length) { 2 }

    let(:belongs_to) {
      JIRA::Resource::Issue.new(client, :attrs => {
        'id' => '10002', 'fields' => {
          'comment' => {'comments' => []}
        }
      })
    }

    let(:expected_attributes) do
      {
        'self' => "http://localhost:2990/jira/rest/api/2/issue/10002/comment/10000",
        'id'   => key,
        'body' => "This is a comment. Creative."
      }
    end

    let(:attributes_for_post) {
      {"body" => "new comment"}
    }
    let(:expected_attributes_from_post) {
      { "id" => "10001", "body" => "new comment"}
    }

    let(:attributes_for_put) {
      {"body" => "new body"}
    }
    let(:expected_attributes_from_put) {
      { "id" => "10000", "body" => "new body" }
    }<commit_msg>Fixing whitespace in comment spec.<commit_after>require 'spec_helper'

describe JIRA::Resource::Comment do

  with_each_client do |site_url, client|
    let(:client) { client }
    let(:site_url) { site_url }

    let(:key) { "10000" }

    let(:target) { JIRA::Resource::Comment.new(client, :attrs => {'id' => '99999'}, :issue_id => '54321') }

    let(:expected_collection_length) { 2 }

    let(:belongs_to) {
      JIRA::Resource::Issue.new(client, :attrs => {
        'id' => '10002',
        'fields' => {
          'comment' => {'comments' => []}
        }
      })
    }

    let(:expected_attributes) do
      {
        'self' => "http://localhost:2990/jira/rest/api/2/issue/10002/comment/10000",
        'id'   => key,
        'body' => "This is a comment. Creative."
      }
    end

    let(:attributes_for_post) {
      { "body" => "new comment" }
    }
    let(:expected_attributes_from_post) {
      { "id" => "10001", "body" => "new comment"}
    }

    let(:attributes_for_put) {
      {"body" => "new body"}
    }
    let(:expected_attributes_from_put) {
      { "id" => "10000", "body" => "new body" }
    }
{'fraction_non_alphanumeric': 0.18955425484016208, 'fraction_numerical': 0.041422782530391715, 'mean_word_length': 2.5608974358974357, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1664413', 'n_tokens_mistral': 853, 'n_tokens_neox': 771, 'n_words': 134}