Sha256: c9012c999fbc8e05beba497bbe5b425e6d4072f2322c9839de2829a3ec588ed2
Contents?: true
Size: 973 Bytes
Versions: 9
Compression:
Stored size: 973 Bytes
Contents
RSpec.describe Rambo::RamlModels::Body do let(:raml) { Raml::Parser.parse_file(raml_file) } let(:body) { raml.resources.first.http_methods.first.responses.first.bodies.first } subject { described_class.new(body) } describe "#content_type" do let(:raml_file) { File.join(SPEC_DIR_ROOT, "support/foobar.raml") } it "returns the content type" do expect(subject.content_type).to eql body.content_type end end describe "#example" do context "when an example is given" do let(:raml_file) { File.join(SPEC_DIR_ROOT, "support/foobar.raml") } it "returns an example" do expect(subject.example).to eql body.example end end context "when a schema is given" do let(:raml_file) { File.join(SPEC_DIR_ROOT, "../features/support/examples/raml/basic_raml_with_schema.raml") } it "returns generated JSON data" do expect(JSON.parse(subject.example)).to have_key "data" end end end end
Version data entries
9 entries across 9 versions & 1 rubygems