Sha256: 79733dd8acd8ae091a0db652ae47e5faf36c39d80ddc9e6b0b1784e802af0a96

Contents?: true

Size: 1.26 KB

Versions: 6

Compression:

Stored size: 1.26 KB

Contents

include ApiResource

Mocks.define do
  
  endpoint('/single_object_association') do
    get(HashDealer.roll(:test_association_resource), :params => {})
    get(HashDealer.roll(:active_test_association_resource), :params => {:active => true})
    get(HashDealer.roll(:active_birthday_test_association_resource), :params => {:active => true, :birthday => true})
  end

  endpoint('/multi_object_association') do
    get((0..4).to_a.collect{HashDealer.roll(:test_association_resource)}, :params => {})
    get((0..4).to_a.collect{HashDealer.roll(:active_test_association_resource)}, :params => {:active => true})
    get((0..4).to_a.collect{HashDealer.roll(:active_test_association_resource)}, :params => {:active => false})
    get((0..4).to_a.collect{HashDealer.roll(:active_birthday_test_association_resource)}, :params => {:active => true, :birthday => true})
  end

  endpoint("/has_one_objects/new") do
    get({})
  end
  
  endpoint("/has_many_objects/new") do
    get({
      "attributes" => {
        "public" => ["name"]
      }
    })
  end
  
  endpoint("/belongs_to_objects/new") do
    get({})
  end
  
  endpoint("/test_associations/new") do
    get({})
  end
  
  endpoint("/inner_classes/new") do
    get({})
  end
  
  endpoint("/childern/new") do
    get({})
  end
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
api_resource-0.2.6 spec/support/mocks/association_mocks.rb
api_resource-0.2.5 spec/support/mocks/association_mocks.rb
api_resource-0.2.4 spec/support/mocks/association_mocks.rb
api_resource-0.2.3 spec/support/mocks/association_mocks.rb
api_resource-0.2.2 spec/support/mocks/association_mocks.rb
api_resource-0.2.1 spec/support/mocks/association_mocks.rb