Sha256: c717f8e58f0745cbdf042926d1557d63cf63f5644d43d27cbb03b2816bfccf52

Contents?: true

Size: 366 Bytes

Versions: 23

Compression:

Stored size: 366 Bytes

Contents

require 'spec_helper'
require 'napa/json_error'

describe Napa::JsonError do
  context '#to_json' do
    it 'returns a json hash with the error data' do
      error = Napa::JsonError.new(:code, 'message').to_json
      parsed = JSON.parse(error)

      parsed['error']['code'].should eq('code')
      parsed['error']['message'].should eq('message')
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
napa-0.3.0 spec/json_error_spec.rb
napa-0.2.1 spec/json_error_spec.rb
napa-0.2.0 spec/json_error_spec.rb
napa-0.1.29 spec/json_error_spec.rb
napa-0.1.28 spec/json_error_spec.rb
napa-0.1.26 spec/json_error_spec.rb
napa-0.1.25 spec/json_error_spec.rb
napa-0.1.24 spec/json_error_spec.rb
napa-0.1.23 spec/json_error_spec.rb
napa-0.1.22 spec/json_error_spec.rb
napa-0.1.21 spec/json_error_spec.rb
napa-0.1.20 spec/json_error_spec.rb
napa-0.1.19 spec/json_error_spec.rb
napa-0.1.18 spec/json_error_spec.rb
napa-0.1.17 spec/json_error_spec.rb
napa-0.1.16 spec/json_error_spec.rb
napa-0.1.15 spec/json_error_spec.rb
napa-0.1.14 spec/json_error_spec.rb
napa-0.1.12 spec/json_error_spec.rb
napa-0.1.13 spec/json_error_spec.rb