spec/conglomerate_spec.rb in conglomerate-0.2.0 vs spec/conglomerate_spec.rb in conglomerate-0.2.1
- old
+ new
@@ -32,24 +32,17 @@
end
class ConglomerateExtraTestSerializer
include Conglomerate.serializer
- href { "" }
attribute :id
end
class ConglomerateNullSerializer
include Conglomerate.serializer
-
- href { "" }
end
-class ConglomerateInvalidSerializer
- include Conglomerate.serializer
-end
-
describe Conglomerate do
let(:object) do
double(
"Object",
:id => 1,
@@ -94,22 +87,16 @@
let(:null_serializer) do
ConglomerateNullSerializer.new(object, :context => context).serialize
end
- let(:invalid_serializer) do
- ConglomerateInvalidSerializer.new(object, :context => context).serialize
- end
-
let(:test_collection) { test_serializer["collection"] }
let(:extra_test_collection) { extra_test_serializer["collection"] }
let(:null_collection) { null_serializer["collection"] }
- let(:invalid_collection) { invalid_serializer["collection"] }
-
describe "#version" do
it "sets version to 1.0" do
expect(null_collection["version"]).to eq("1.0")
expect(test_collection["version"]).to eq("1.0")
end
@@ -118,11 +105,11 @@
describe "#href" do
it "in context, uses the block to set the collection href" do
expect(test_collection["href"]).to eq("abc")
end
- it "errors if no href given" do
- expect { invalid_collection["href"] }.to raise_error
+ it "isn't included if the href is nil" do
+ expect(null_collection["href"]).to be_nil
end
end
describe "#query" do
it "doesn't include any query templates if none are provided" do