Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def setup
- ActiveResource::HttpMock.respond_to do |mock|
- mock.get "/users/authenticated.xml?password=secret&username=andres%40joyent.com", {}, user(:authenticated)
- mock.get "/organizations/123.xml", {}, organization(:acme)
- mock.get "/organizations/123/users.xml", {}, user(:users)
- mock.get "/organizations/123/users/1.xml", {}, user(:andres)
- mock.get "/organizations/123/users/2.xml", {}, user(:luis)
- mock.get "/organizations/123/users/4.xml", {}, nil, 404
- mock.put "/users/1.xml", {}, nil, 200
- end
- # Finding users should be User.find(id, :params => {:organization_id => org_id})
- # but dont know how to do this since there are two routings for users resource:
- # one for authentication and one for users belonging to an organization
- @acme = Organization.find(123)
- end
Add Comment
Please, Sign In to add comment