class Mogli::TestUser
Support for Facebook test users, as described here:
developers.facebook.com/docs/test_users/
Test user creation/listing requires an app access token and an app id.
Example usage:
+Mogli::TestUser.all({}, Mogli::AppClient.new
(‘access_token’, ‘app_id’))+
Public Class Methods
# File lib/mogli/test_user.rb, line 36 def self.all(app_client) app_client.get_and_map("#{app_client.application_id}/accounts/test-users", self, {}) end
test_user_params can include:
installed: This is a Boolean parameter to specify whether your app should be installed for the test user at the time of creation. It is true by default.
name: this is an optional string parameter. You can specify a name for the test user you create. The specified name will also be used in the email address assigned to the test user.
permissions: This is a comma-separated list of extended permissions. Your app is granted these permissions for the new test user if installed is true.
Example usage:
Mogli::TestUser.create
({:installed => false, :name => ‘Zark Muckerberg’, :permissions => ‘user_events,create_event’}, client)
# File lib/mogli/test_user.rb, line 32 def self.create(test_user_params, app_client) app_client.post("accounts/test-users", self, test_user_params) end
Public Instance Methods
# File lib/mogli/test_user.rb, line 40 def to_s # name is nil by default, so use id id.to_s end