Sha256: da8e450d923be9b1287eb825af87319fce4b4c686a76016fe0cd16d7423b83b9

Contents?: true

Size: 747 Bytes

Versions: 1

Compression:

Stored size: 747 Bytes

Contents

require 'helper'

class TestClient < Test::Unit::TestCase
  def setup
    Parse.init
  end
  
  def test_simple_save
    test_save = Parse::Object.new "TestSave"
    test_save["foo"] = "bar"
    test_save.save

    assert_equal test_save["foo"], "bar"
    assert_equal test_save[Parse::Protocol::KEY_CREATED_AT].class, String
    assert_equal test_save[Parse::Protocol::KEY_OBJECT_ID].class, String
  end
  
  def test_update
    foo = Parse::Object.new "TestSave"
    foo["age"] = 20
    foo.save
    
    assert_equal foo["age"], 20
    assert_equal foo[Parse::Protocol::KEY_UPDATED_AT], nil
    
    foo["age"] = 40
    foo.save
    
    assert_equal foo["age"], 40
    assert_equal foo[Parse::Protocol::KEY_UPDATED_AT].class, String
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
parse-ruby-client-0.0.3 test/test_client.rb