Sha256: cb38d1a3344730c3d60fe6b5cd65db00b817c6eb0bd30b8b6b7fc9e555fbb6c6

Contents?: true

Size: 680 Bytes

Versions: 16

Compression:

Stored size: 680 Bytes

Contents

require 'rails_helper'

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

    before(:each) 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

16 entries across 16 versions & 1 rubygems

Version Path
lhs-15.3.1 spec/record/build_spec.rb
lhs-15.3.1.pre.fixlhc.1 spec/record/build_spec.rb
lhs-15.3.0 spec/record/build_spec.rb
lhs-15.2.5 spec/record/build_spec.rb
lhs-15.2.4 spec/record/build_spec.rb
lhs-15.2.3 spec/record/build_spec.rb
lhs-15.2.3.pre.favorites.1 spec/record/build_spec.rb
lhs-15.2.2.pre.favorites.1 spec/record/build_spec.rb
lhs-15.2.2 spec/record/build_spec.rb
lhs-15.2.1 spec/record/build_spec.rb
lhs-15.2.0 spec/record/build_spec.rb
lhs-15.1.1 spec/record/build_spec.rb
lhs-15.1.0 spec/record/build_spec.rb
lhs-15.0.2 spec/record/build_spec.rb
lhs-15.0.1 spec/record/build_spec.rb
lhs-15.0.0 spec/record/build_spec.rb