Sha256: ecd6526267d1219b0fff117ef4be3ecb785d43b40f69c243802bc85053d55a6c
Contents?: true
Size: 962 Bytes
Versions: 17
Compression:
Stored size: 962 Bytes
Contents
require 'test_helper' class Gecko::Record::ProductAdapterTest < Minitest::Test include TestingAdapter include SharedAdapterExamples include SharedSideloadedDataParsingExamples let(:adapter) { @client.Product } let(:plural_name) { 'products' } let(:record_class) { Gecko::Record::Product } let(:children) { ["variants"] } def test_initializes_adapter assert_instance_of(Gecko::Record::ProductAdapter, @client.Product) end def test_saves_new_record VCR.use_cassette(plural_name + '_new_valid') do record = adapter.build(name: 'Gary') assert record.save assert record.id assert adapter.has_record_for_id?(record.id) end end def test_invalid_new_record VCR.use_cassette(plural_name + '_new_invalid') do record = adapter.build(product_type: 'Gecko') assert !record.save assert !record.id assert_equal record.errors[:name], ["can't be blank"] end end end
Version data entries
17 entries across 17 versions & 1 rubygems