Sha256: dcfef9787e7e529d4524e580e6cb951de342c667f1ac76fbb5d77fd4c4461a07

Contents?: true

Size: 524 Bytes

Versions: 3

Compression:

Stored size: 524 Bytes

Contents

require 'spec_helper'
require 'apiture/swagger/specification'

describe Apiture::Swagger::Specification do

  it "should serialize security node as key and scopes" do
    spec = described_class.new

    security = Apiture::Swagger::Security.new('oauth')
    security.scopes = ['email']
    spec.security = { 'oauth' => security }

    hash = spec.serializable_hash
    security_hash = hash['security'] 
    expect(security_hash).to_not be_nil
    scopes = security_hash['oauth']
    expect(scopes).to eq ['email']
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
apiture-0.2.2 spec/apiture/swagger/specification_spec.rb
apiture-0.2.1 spec/apiture/swagger/specification_spec.rb
apiture-0.2.0 spec/apiture/swagger/specification_spec.rb