Sha256: 345d92ec7fbf8aad2ed7eb36166685a9e4e19662ef8b9e34ca733724cd81bd63

Contents?: true

Size: 753 Bytes

Versions: 12

Compression:

Stored size: 753 Bytes

Contents

require_relative "spec_helper"
require_relative "../lib/conglomerate"

describe Conglomerate::Query do
  let(:query) {
    Conglomerate::Query.new(
      :href => "http://this.is.a.query/",
      :rel => "some_query"
    )
  }

  context "required attributes" do
    specify "href" do
      expect { Conglomerate::Query.new(:rel => "") }.to raise_error("MissingAttribute")
    end

    specify "rel" do
      expect { Conglomerate::Query.new(:href => "") }.to raise_error("MissingAttribute")
    end
  end

  context "data" do
    it "serializes properly" do
      datum = Conglomerate::Datum.new(:name => "name")

      query.data << datum
      expect(Conglomerate.serialize(query)["data"]).to include(Conglomerate.serialize(datum))
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
conglomerate-0.16.0 spec/query_spec.rb
conglomerate-0.15.0 spec/query_spec.rb
conglomerate-0.14.0 spec/query_spec.rb
conglomerate-0.13.0 spec/query_spec.rb
conglomerate-0.12.1 spec/query_spec.rb
conglomerate-0.12.0 spec/query_spec.rb
conglomerate-0.11.1 spec/query_spec.rb
conglomerate-0.11.0 spec/query_spec.rb
conglomerate-0.10.0 spec/query_spec.rb
conglomerate-0.9.0 spec/query_spec.rb
conglomerate-0.8.1 spec/query_spec.rb
conglomerate-0.8.0 spec/query_spec.rb