Sha256: 6207dcf34ce3726ec31c2326cb974bbf03c95440c38cd2a9084b964ffabd16bb

Contents?: true

Size: 704 Bytes

Versions: 76

Compression:

Stored size: 704 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

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

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

    it 'builds a new item from scratch' do
      feedback = Feedback.build recommended: true
      expect(feedback).to be_kind_of Feedback
      expect(feedback.recommended).to eq true
      stub_request(:post, 'http://local.ch/v2/feedbacks')
        .with(body: "{\"recommended\":true}")
      feedback.save
    end
  end
end

Version data entries

76 entries across 76 versions & 1 rubygems

Version Path
lhs-21.0.0 spec/record/build_spec.rb
lhs-20.1.4 spec/record/build_spec.rb
lhs-20.1.3.pre.paginationfix.3 spec/record/build_spec.rb
lhs-20.1.3.pre.paginationfix.2 spec/record/build_spec.rb
lhs-20.1.3.pre.paginationfix.1 spec/record/build_spec.rb
lhs-20.1.2 spec/record/build_spec.rb
lhs-20.1.1 spec/record/build_spec.rb
lhs-20.0.0 spec/record/build_spec.rb
lhs-19.10.0 spec/record/build_spec.rb
lhs-19.9.0 spec/record/build_spec.rb
lhs-19.8.2 spec/record/build_spec.rb
lhs-19.8.1 spec/record/build_spec.rb
lhs-19.8.0 spec/record/build_spec.rb
lhs-19.7.0 spec/record/build_spec.rb
lhs-19.6.0 spec/record/build_spec.rb
lhs-19.5.0 spec/record/build_spec.rb
lhs-19.5.0.pre.wherehref.1 spec/record/build_spec.rb
lhs-19.4.1 spec/record/build_spec.rb
lhs-19.4.0 spec/record/build_spec.rb
lhs-19.3.1 spec/record/build_spec.rb