Sha256: fc805a5b0b4e04e5947c1408d29b67725a216bb9ef2df874a69e6c7bda3fb51e

Contents?: true

Size: 759 Bytes

Versions: 2

Compression:

Stored size: 759 Bytes

Contents

require 'spec_helper'

describe HackernewsApi::Comment do
  let(:comment) do
    VCR.use_cassette('comment') do
      described_class.fetch 2921983
    end
  end

  it '#id' do
    expect(comment.id).to eq 2921983
  end

  it '#by' do
    expect(comment.by).to eq "norvig"
  end

  it '#kids' do
    expect(comment.kids).to include 2922709
  end

  it '#parent' do
    expect(comment.parent).to eq 2921506
  end

  it '#text' do
    expect(comment.text).to eq "Aw shucks, guys ... you make me blush with your compliments.<p>Tell you what, Ill make a deal: I'll keep writing if you keep reading. K?"
  end

  it '#time' do
    expect(comment.time.to_s).to eq "2011-08-24T18:38:47+00:00"
  end
  it '#type' do
    expect(comment.type).to eq "comment"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hackernews_api-0.0.2 spec/comment_spec.rb
hackernews_api-0.0.1 spec/comment_spec.rb