summaryrefslogtreecommitdiff
path: root/test/edit_objects.rb
blob: e6e8d716479df4fb05c2efe2abc349a88fc01acb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
require_relative "setup.rb"

class FeatureRestTest < MiniTest::Test
  
  # edit object metadata and compare
  def test_metadata
    # OpenTox::Feature
    # create object, pass additional values
    f = OpenTox::Feature.new 
    f.title = "first"
    f.description = "first test description"
    f.put
    
    # get object to compare first
    f2 = OpenTox::Feature.find f.uri
    assert_equal f.title, f2.title
    assert_equal f.description, f2.description

    # edit object and PUT back
    f2.title = "second"
    f2.description = f.description.reverse
    f2.put
    
    # get object to compare again
    f3 = OpenTox::Feature.find f.uri
    refute_equal f.title, f3.title
    refute_equal f.description, f3.description
  end
  
  # TODO edit object and compare rdf representation

  
end