Sha256: 14bd7ac75cde1ecfd32c4fccd39108268a0e3b67e273d6b356b2c60265d2748c

Contents?: true

Size: 873 Bytes

Versions: 5

Compression:

Stored size: 873 Bytes

Contents

require "spec_helper"

describe NPR::Entity::Parent do
  json_fixture do
    <<-JSON
      {
        "id": "166488606",
        "type": "author",
        "title": {
          "$text": "Richard K. Morgan"
        },
        "link": [
          {
            "type": "html",
            "$text": "http://www.npr.org/books/authors/166488606/richard-k-morgan?ft=3&f=166480907"
          },
          {
            "type": "api",
            "$text": "http://api.npr.org/query?id=166488606&apiKey=MDA1OTI3MjQ5MDEyODUwMTE2MzM1YzNmZA004"
          }
        ]
      }
    JSON
  end

  before :each do
    @parent = NPR::Entity::Parent.new(@fixture)
  end

  it "sets up attributes" do
    @parent.id.should be_a Integer
    @parent.type.should eq "author"
    @parent.title.should eq "Richard K. Morgan"
  end

  it "has links" do
    @parent.links.should_not be_empty
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
npr-3.0.0 spec/unit/entity/parent_spec.rb
npr-2.0.2 spec/unit/entity/parent_spec.rb
npr-2.0.1 spec/unit/entity/parent_spec.rb
npr-2.0.0 spec/unit/entity/parent_spec.rb
npr-1.2.0 spec/unit/entity/parent_spec.rb