Sha256: 60b5b8909dc04eca4413f0313a92bc0ff4ece9d642e82648a3855baffbbc9938

Contents?: true

Size: 673 Bytes

Versions: 19

Compression:

Stored size: 673 Bytes

Contents

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

19 entries across 19 versions & 1 rubygems

Version Path
lhs-16.1.5 spec/record/build_spec.rb
lhs-16.1.4 spec/record/build_spec.rb
lhs-16.1.3 spec/record/build_spec.rb
lhs-16.1.2 spec/record/build_spec.rb
lhs-16.1.1 spec/record/build_spec.rb
lhs-16.1.0 spec/record/build_spec.rb
lhs-16.0.1 spec/record/build_spec.rb
lhs-16.0.0 spec/record/build_spec.rb
lhs-15.7.0 spec/record/build_spec.rb
lhs-15.6.1 spec/record/build_spec.rb
lhs-15.6.0 spec/record/build_spec.rb
lhs-15.5.1 spec/record/build_spec.rb
lhs-15.5.0 spec/record/build_spec.rb
lhs-15.4.1 spec/record/build_spec.rb
lhs-15.4.0 spec/record/build_spec.rb
lhs-15.4.0.pre.hasone.1 spec/record/build_spec.rb
lhs-15.3.3 spec/record/build_spec.rb
lhs-15.3.3.pre.fixoptions.1 spec/record/build_spec.rb
lhs-15.3.2 spec/record/build_spec.rb