Sha256: 6190fa54cc289107663c46a2581ff45c21259db9185bac1eaac306e70792d6f5

Contents?: true

Size: 675 Bytes

Versions: 130

Compression:

Stored size: 675 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

130 entries across 130 versions & 1 rubygems

Version Path
lhs-14.6.5 spec/record/build_spec.rb
lhs-14.6.4 spec/record/build_spec.rb
lhs-14.6.3 spec/record/build_spec.rb
lhs-14.6.2 spec/record/build_spec.rb
lhs-14.6.1 spec/record/build_spec.rb
lhs-14.6.0 spec/record/build_spec.rb
lhs-14.5.0 spec/record/build_spec.rb
lhs-14.4.0 spec/record/build_spec.rb
lhs-14.3.4 spec/record/build_spec.rb
lhs-14.3.3 spec/record/build_spec.rb
lhs-14.3.2 spec/record/build_spec.rb
lhs-14.3.1 spec/record/build_spec.rb
lhs-14.3.0 spec/record/build_spec.rb
lhs-14.2.0 spec/record/build_spec.rb
lhs-14.1.1 spec/record/build_spec.rb
lhs-14.1.0 spec/record/build_spec.rb
lhs-14.0.3 spec/record/build_spec.rb
lhs-14.0.2 spec/record/build_spec.rb
lhs-14.0.1 spec/record/build_spec.rb
lhs-14.0.0 spec/record/build_spec.rb