Sha256: 457674d1450e7e82b49c52a80844ccc4779085f9307c7cf16c4e96e6fe4690b4

Contents?: true

Size: 528 Bytes

Versions: 11

Compression:

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

11 entries across 11 versions & 1 rubygems

Version Path
gecko-ruby-0.9.1 test/support/shared_record_examples.rb
gecko-ruby-0.9.0 test/support/shared_record_examples.rb
gecko-ruby-0.8.0 test/support/shared_record_examples.rb
gecko-ruby-0.2.6 test/support/shared_record_examples.rb
gecko-ruby-0.7.1 test/support/shared_record_examples.rb
gecko-ruby-0.7.0 test/support/shared_record_examples.rb
gecko-ruby-0.6.0 test/support/shared_record_examples.rb
gecko-ruby-0.5.0 test/support/shared_record_examples.rb
gecko-ruby-0.2.5 test/support/shared_record_examples.rb
gecko-ruby-0.2.4 test/support/shared_record_examples.rb
gecko-ruby-0.2.3 test/support/shared_record_examples.rb