Sha256: ed604edfe8f7d37b8aef0a750e3efbfa1b6c3fc02b78efbe1da3e0671664ef26

Contents?: true

Size: 910 Bytes

Versions: 2

Compression:

Stored size: 910 Bytes

Contents

require "spec_helper"

describe NPR::Entity::Byline do
  json_fixture do
    <<-JSON
      {
        "id": "166885535",
        "name": {
          "personId": "134991966",
          "$text": "Julie Bierach"
        },
        "link": [
          {
            "type": "html",
            "$text": "http://news.stlpublicradio.org/people/julie-bierach"
          },
          {
            "type": "api",
            "$text": "http://api.npr.org/query?id=134991966&apiKey=MDA1OTI3MjQ5MDEyODUwMTE2MzM1YzNmZA004"
          }
        ]
      }
    JSON
  end
  
  before :each do
    @byline = NPR::Entity::Byline.new(@fixture)
  end
  
  it "sets up attributes" do
    @byline.id.should be_a Fixnum
    @byline.id.should_not eq 0
  end
  
  it "creates relations" do
    @byline.links.size.should eq 2
    @byline.links.first.should be_a NPR::Entity::Link
    @byline.name.should be_a NPR::Entity::Name
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
npr-1.1.0 spec/unit/entity/byline_spec.rb
npr-0.1.2 spec/unit/entity/byline_spec.rb