Sha256: 02728aea3566fae0dd7f90c0651776669caf6cd2449e675f8a22189cf0d63618
Contents?: true
Size: 902 Bytes
Versions: 13
Compression:
Stored size: 902 Bytes
Contents
require 'spec_helper' module ApiResource module Associations describe HasManyRemoteObjectProxy do before(:all) do TestResource.reload_resource_definition end context "#<<" do it "implements the shift operator" do tr = TestResource.new tr.has_many_objects << HasManyObject.new tr.has_many_objects.length.should be 1 end end context "#load" do it "does a find based on its set of ids if present" do tr = TestResource.new tr.has_many_object_ids = [1,2] HasManyObject.connection.expects(:get) .with("/has_many_objects.json?ids%5B%5D=1&ids%5B%5D=2") .returns([{"name" => "Test"}]) tr.has_many_objects.length.should be 1 tr.has_many_objects.first.name.should eql("Test") end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems