Sha256: 2415be95882fb9445f79515137fdfab0368c46470db7d742f578a379fef6ef76

Contents?: true

Size: 992 Bytes

Versions: 15

Compression:

Stored size: 992 Bytes

Contents

include ApiResource

Mocks.define do
  
  endpoint("/test_resources/new") do
    get(HashDealer.roll(:new_test_object))
  end
  
  endpoint("/test_resources") do
    post(HashDealer.roll(:test_resource).merge(:id => 1), :params => {:test_resource => HashDealer.roll(:test_resource).matcher})
    get((0..4).to_a.collect{HashDealer.roll(:test_resource)})
    get((0..4).to_a.collect{HashDealer.roll(:test_resource)}, :params => {:active => true})
  end
  
  endpoint("/test_resources/:id") do
    get(HashDealer.roll(:test_resource)) do |params|
      self.merge(params)
    end
    delete({})
    put({}, :params => {:test_resource => HashDealer.roll(:test_resource).matcher})
  end
  
  endpoint("/child_test_resources/new") do
    get({})
  end
  
  endpoint("/child_test_resource2s/new") do
    get({})
  end
  
  endpoint("/another_test_resources/new") do
    get({})
  end
  
  endpoint("/test_classes/new") do
    get({})
  end
  
  endpoint("/children/new") do
    get({})
  end
  
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
api_resource-0.3.3 spec/support/mocks/test_resource_mocks.rb
api_resource-0.3.2 spec/support/mocks/test_resource_mocks.rb
api_resource-0.3.1 spec/support/mocks/test_resource_mocks.rb
api_resource-0.3.0 spec/support/mocks/test_resource_mocks.rb
api_resource-0.2.11 spec/support/mocks/test_resource_mocks.rb
api_resource-0.2.10 spec/support/mocks/test_resource_mocks.rb
api_resource-0.2.9 spec/support/mocks/test_resource_mocks.rb
api_resource-0.2.8 spec/support/mocks/test_resource_mocks.rb
api_resource-0.2.7 spec/support/mocks/test_resource_mocks.rb
api_resource-0.2.6 spec/support/mocks/test_resource_mocks.rb
api_resource-0.2.5 spec/support/mocks/test_resource_mocks.rb
api_resource-0.2.4 spec/support/mocks/test_resource_mocks.rb
api_resource-0.2.3 spec/support/mocks/test_resource_mocks.rb
api_resource-0.2.2 spec/support/mocks/test_resource_mocks.rb
api_resource-0.2.1 spec/support/mocks/test_resource_mocks.rb