spec/integration/render/schema_spec.rb in render-0.0.8 vs spec/integration/render/schema_spec.rb in render-0.0.9
- old
+ new
@@ -23,26 +23,26 @@
Object.send(:remove_const, :TransformerExample)
end
it "stubs data for testing" do
name = "am I transforming this right?"
- rendered_stub = Render::Schema.new(:films_show).serialize!({ name: name })
+ rendered_stub = Render::Schema.new("films_show").serialize!({ name: name })
stub_request(:get, "http://films.local").to_return({ body: rendered_stub.to_json })
TransformerExample.process_name[:transformed_to].should == name
end
it "enforces schema's definition" do
name = "am I transforming this right?"
- rendered_stub = Render::Schema.new(:films_show).serialize!({ wrong_key: name })
+ rendered_stub = Render::Schema.new("films_show").serialize!({ wrong_key: name })
stub_request(:get, "http://films.local").to_return({ body: rendered_stub.to_json })
TransformerExample.process_name[:transformed_to].should_not == name
end
it "prevents errors related to code anticipating actual data" do
- rendered_stub = Render::Schema.new(:films_show).serialize!
+ rendered_stub = Render::Schema.new("films_show").serialize!
stub_request(:get, "http://films.local").to_return({ body: rendered_stub.to_json })
expect {
response = TransformerExample.process_name
}.not_to raise_error
@@ -65,10 +65,10 @@
type: String,
enum: ["horror", "action", "sci-fi"]
},
tags: {
type: Array,
- required: true,
+ minItems: 1,
items: {
type: Object,
properties: {
name: { type: String },
id: { type: Integer }