Sha256: 6ae3483cc8cbe23f6d0052c23a9e22fee08bf29c59e74ccf3bbe8eb09f457090
Contents?: true
Size: 1.23 KB
Versions: 1
Compression:
Stored size: 1.23 KB
Contents
require 'test_helper' class Gecko::Record::AccountAdapterTest < Minitest::Test include TestingAdapter include SharedAdapterExamples undef :test_adapter_count # Can't build accounts via API undef :test_build undef :test_build_with_attributes undef :test_saving_new_record undef :test_saving_new_invalid_record let(:adapter) { @client.Account } let(:plural_name) { 'accounts' } let(:record_class) { Gecko::Record::Account } def test_initializes_adapter assert_instance_of(Gecko::Record::AccountAdapter, @client.Account) end def test_current VCR.use_cassette('accounts#current') do assert_instance_of(Gecko::Record::Account, @client.Account.current) assert(@client.Account.current, 'Account.current is identity mapped') end end def test_adapter_all VCR.use_cassette(plural_name) do collection = adapter.where(limit: 5) assert_instance_of(Array, collection) assert_equal(1, collection.size) assert_instance_of(record_class, collection[0]) end end def test_adapter_uses_identity_map VCR.use_cassette(plural_name) do collection = adapter.where(limit: 5) assert_equal(collection.first, adapter.find(collection.first.id)) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
gecko-ruby-0.0.4 | test/record/account_adapter_test.rb |