Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ApplicationController < ActionController::Base
- include RemoteFixturesLoader
- before_filter :setup_mocks
- helper :all # include all helpers, all the time
- # See ActionController::RequestForgeryProtection for details
- # Uncomment the :secret if you're not using the cookie session store
- protect_from_forgery # :secret => 'a43fadeddd028836dce0919e9576c969'
- def setup_mocks
- remote_fixtures(:accelerators, :cloud_applications, :organizations, :users)
- ActiveResource::HttpMock.respond_to do |mock|
- mock.get "/users/1.xml", {}, "<?xml version=\"1.0\" encoding=\"UTF-8\"?><user><id type=\"integer\">1</id><name>Andres Rodriguez</name><email>andres@joyent.com</email></user>", 200
- 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
- end
- end
Add Comment
Please, Sign In to add comment