Sha256: 12954ea9425c0f07f83f1bcda696a2b02e75cc694cfe9083c2fe1340045dd693

Contents?: true

Size: 529 Bytes

Versions: 76

Compression:

Stored size: 529 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

describe LHS::Record do
  context 'to_json' do
    let(:datastore) { 'http://local.ch/v2' }

    before do
      LHC.config.placeholder('datastore', datastore)
      class Feedback < LHS::Record
        endpoint '{+datastore}/feedbacks'
      end
    end

    it 'converts to json' do
      feedback = Feedback.new recommended: true
      expect(feedback.as_json).to eq('recommended' => true)
      expect(feedback.to_json).to eq("{\"recommended\":true}")
    end
  end
end

Version data entries

76 entries across 76 versions & 1 rubygems

Version Path
lhs-26.2.0 spec/record/to_json_spec.rb
lhs-26.1.0 spec/record/to_json_spec.rb
lhs-26.0.1 spec/record/to_json_spec.rb
lhs-26.0.0 spec/record/to_json_spec.rb
lhs-25.2.0 spec/record/to_json_spec.rb
lhs-25.1.0 spec/record/to_json_spec.rb
lhs-25.0.4 spec/record/to_json_spec.rb
lhs-25.0.3 spec/record/to_json_spec.rb
lhs-25.0.2 spec/record/to_json_spec.rb
lhs-25.0.1 spec/record/to_json_spec.rb
lhs-25.0.0 spec/record/to_json_spec.rb
lhs-24.1.2 spec/record/to_json_spec.rb
lhs-24.1.1 spec/record/to_json_spec.rb
lhs-24.1.0 spec/record/to_json_spec.rb
lhs-24.1.0.pre.2 spec/record/to_json_spec.rb
lhs-24.1.0.pre.1 spec/record/to_json_spec.rb
lhs-24.0.0 spec/record/to_json_spec.rb
lhs-23.0.2 spec/record/to_json_spec.rb
lhs-23.0.1 spec/record/to_json_spec.rb
lhs-23.0.0 spec/record/to_json_spec.rb