Sha256: e99d8087ff5dad8fd4932f048e6fc63fba428f1a2d3523c49423df8d19a447d5

Contents?: true

Size: 524 Bytes

Versions: 10

Compression:

Stored size: 524 Bytes

Contents

module SharedRecordExamples
  def test_sets_up_id
    assert_instance_of(Fixnum, @record.id)
    assert_equal(@json['id'], @record.id)
  end

  def test_persisted?
    assert record_class.new(client, id: 123).persisted?
    assert !record_class.new(client, {}).persisted?
    assert !record_class.new(client).persisted?
  end

  def test_saving
    @client.adapter_for(record_class.demodulized_name).expects(:save).with(@record)
    @record.save
  end

  def client
    @client ||= Gecko::Client.new('ABC', 'DEF')
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
gecko-ruby-0.2.2 test/support/shared_record_examples.rb
gecko-ruby-0.2.0 test/support/shared_record_examples.rb
gecko-ruby-0.1.0 test/support/shared_record_examples.rb
gecko-ruby-0.0.10 test/support/shared_record_examples.rb
gecko-ruby-0.0.9 test/support/shared_record_examples.rb
gecko-ruby-0.0.8 test/support/shared_record_examples.rb
gecko-ruby-0.0.7 test/support/shared_record_examples.rb
gecko-ruby-0.0.6 test/support/shared_record_examples.rb
gecko-ruby-0.0.5 test/support/shared_record_examples.rb
gecko-ruby-0.0.4 test/support/shared_record_examples.rb