<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>.autotest</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,7 +1,6 @@
 # -*- ruby -*-
 # 
 require 'rubygems'
-ENV['RUBY_FLAGS']=&quot;-I#{%w(lib ext bin test).join(File::PATH_SEPARATOR)}&quot;
 require 'hoe'
 begin
   require 'load_multi_rails_rake_tasks'</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 begin
   unless Object.const_defined?(&quot;ActiveSupport&quot;) and ActiveSupport.const_defined?(&quot;JSON&quot;)
-    require 'json' 
+    require 'json'
     module Facebooker
       def self.json_decode(str)
         JSON.parse(str)
@@ -12,9 +12,9 @@ begin
         ActiveSupport::JSON.decode(str)
       end
     end
-  end 
+  end
 rescue
-  require 'json' 
+  require 'json'
 end
 require 'zlib'
 require 'digest/md5'
@@ -22,9 +22,15 @@ require 'digest/md5'
 
 
 module Facebooker
-      
+
+    @facebooker_configuration = {}
+    @current_adapter = nil
+    @set_asset_host_to_callback_url = nil
+    @path_prefix = nil
+    @use_curl    = false
+
     class &lt;&lt; self
-    
+
     def load_configuration(facebooker_yaml_file)
       if File.exist?(facebooker_yaml_file)
         if defined? RAILS_ENV
@@ -35,7 +41,7 @@ module Facebooker
         apply_configuration(config)
       end
     end
-    
+
     # Sets the Facebook environment based on a hash of options. 
     # By default the hash passed in is loaded from facebooker.yml, but it can also be passed in
     # manually every request to run multiple Facebook apps off one Rails app. 
@@ -53,70 +59,66 @@ module Facebooker
       Facebooker.timeout = config['timeout']
       @facebooker_configuration = config
     end
-    
+
     def facebooker_config
-      @facebooker_configuration || {} # to prevent pretty_errors error if the config hasn't been set yet
-    end
-    
-     def current_adapter=(adapter_class)
-      @current_adapter = adapter_class
+      @facebooker_configuration
     end
-    
+
+    # TODO: This should be converted to attr_accessor, but we need to
+    # get all the require statements at the top of the file to work.
+
+    # Set the current adapter
+    attr_writer :current_adapter
+
+    # Get the current adapter
     def current_adapter
       @current_adapter || Facebooker::AdapterBase.default_adapter
     end
-    
+
     def load_adapter(params)
       self.current_adapter = Facebooker::AdapterBase.load_adapter(params)
     end
-      
+
     def facebook_path_prefix=(path)
       current_adapter.facebook_path_prefix = path
     end
-  
+
     # Default is canvas_page_name in yml file
     def facebook_path_prefix
       current_adapter.facebook_path_prefix
     end
-    
+
     def is_for?(application_container)
       current_adapter.is_for?(application_container)
     end
-    
+
     def set_asset_host_to_callback_url=(val)
       @set_asset_host_to_callback_url=val
     end
-    
+
     def set_asset_host_to_callback_url
-      @set_asset_host_to_callback_url.nil? ? true : @set_asset_host_to_callback_url
-    end
-    
-    def use_curl=(val)
-      @use_curl=val
-    end
-    
-    def use_curl?
-      @use_curl
+      @set_asset_host_to_callback_url || true
     end
-    
+
+    attr_accessor :use_curl
+    alias :use_curl? :use_curl
+
     def timeout=(val)
       @timeout = val.to_i
     end
-    
+
     def timeout
       @timeout
     end
-   
+
     [:api_key,:secret_key, :www_server_base_url,:login_url_base,:install_url_base,:api_rest_path,:api_server_base,:api_server_base_url,:canvas_server_base, :video_server_base].each do |delegated_method|
       define_method(delegated_method){ return current_adapter.send(delegated_method)}
     end
-    
-    
-       def path_prefix
-      @path_prefix
-      end
-    
-    
+
+
+    attr_reader :path_prefix
+
+
     # Set the asset path to the canvas path for just this one request
     # by definition, we will make this a canvas request
     def with_asset_path_for_canvas
@@ -130,7 +132,7 @@ module Facebooker
         ActionController::Base.asset_host = original_asset_host
       end
     end
-  
+
     # If this request is_canvas_request
     # then use the application name as the url root
     def request_for_canvas(is_canvas_request)</diff>
      <filename>lib/facebooker.rb</filename>
    </modified>
    <modified>
      <diff>@@ -37,7 +37,7 @@ module Facebooker
     def self.load_adapter(params)
 
       config_key_base = params[:config_key_base] # This allows for loading of a aspecific adapter
-      config_key_base += &quot;_&quot; unless config_key_base.blank?
+      config_key_base += &quot;_&quot; if config_key_base &amp;&amp; config_key_base.length &gt; 0
 
       unless api_key = (params[:fb_sig_api_key] || facebooker_config[&quot;#{config_key_base}api_key&quot;])
         raise Facebooker::AdapterBase::UnableToLoadAdapter
@@ -52,7 +52,7 @@ module Facebooker
 
         key_base = key.match(/(.*)[_]?api_key/)[1]
 
-        adapter_class_name = if key_base.blank?
+        adapter_class_name = if !key_base || key_base.length == 0
            &quot;FacebookAdapter&quot;
         else
           facebooker_config[key_base + &quot;adapter&quot;]</diff>
      <filename>lib/facebooker/adapters/adapter_base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,16 +12,16 @@ module Facebooker
     def api_rest_path
       &quot;/restserver.php&quot;
     end
-      
+
     def is_for?(application_context)
       application_context == :bebo
     end
-       
+
     def www_server_base_url
       &quot;www.bebo.com&quot;
     end
 
-       
+
     def login_url_base
       &quot;http://#{www_server_base_url}/SignIn.jsp?ApiKey=#{api_key}&amp;v=1.0&quot;
     end
@@ -33,7 +33,6 @@ module Facebooker
 end
 
 # Things that don't actually work as expected in BEBO
-Facebooker::PublishTemplatizedAction
 module Facebooker
    class User
     def set_profile_fbml_with_bebo_adapter(profile_fbml, mobile_fbml, profile_action_fbml, profile_main = nil)
@@ -49,6 +48,9 @@ module Facebooker
     private
     
     BEBO_FIELDS = FIELDS - [:meeting_sex, :wall_count, :meeting_for]
+
+    remove_method :collect
+
     def collect(fields)
       if(Facebooker.is_for?(:bebo) )
          BEBO_FIELDS.reject{|field_name| !fields.empty? &amp;&amp; !fields.include?(field_name)}.join(',')</diff>
      <filename>lib/facebooker/adapters/bebo_adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,19 +5,21 @@ module Facebooker
     attr_reader :method
     class UnexecutedRequest &lt; StandardError; end
     def initialize(params,proc)
-      @method=params[:method]
-      @uri=params.map{|k,v| &quot;#{k}=#{CGI.escape(v.to_s)}&quot;}.join(&quot;&amp;&quot;)
-      @proc=proc
+      @exception  = nil
+      @result     = nil
+      @method     = params[:method]
+      @uri        = params.map{|k,v| &quot;#{k}=#{CGI.escape(v.to_s)}&quot;}.join(&quot;&amp;&quot;)
+      @proc       = proc
     end
-  
+
     def result=(result_object)
       @result = @proc.nil? ? result_object : @proc.call(result_object)
     end
-    
+
     def exception_raised=(ex)
       @exception=ex
     end
-    
+
     def exception_raised?
       @exception.nil? ? false : raise(@exception)
     end
@@ -25,12 +27,11 @@ module Facebooker
     def respond_to?(name)
       super || @result.respond_to?(name)
     end
-  
+
     def ===(other)
       other === @result
     end
-  
-  
+
     def method_missing(name,*args,&amp;proc)
       if @exception
         raise @exception
@@ -41,4 +42,4 @@ module Facebooker
       end
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/facebooker/batch_request.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,16 +9,9 @@ module Facebooker
   end
 
   module Logging
-    
-    def self.skip_api_logging=(val)
-      @skip_api_logging=val
-    end
-    
-    def self.skip_api_logging
-      @skip_api_logging
-    end
-    
-    
+    @skip_api_logging = nil
+    class &lt;&lt; self; attr_accessor :skip_api_logging; end
+
     def self.log_fb_api(method, params)
       message = method # might customize later
       dump = format_fb_params(params)
@@ -36,11 +29,11 @@ module Facebooker
       log_info(message, exception)
       raise
     end
-    
+
     def self.format_fb_params(params)
       params.map { |key,value| &quot;#{key} = #{value}&quot; }.join(', ')
     end
-    
+
     def self.log_info(message, dump, seconds = 0)
       return unless Facebooker.logger
       log_message = &quot;#{message} (#{seconds}) #{dump}&quot;
@@ -48,4 +41,4 @@ module Facebooker
     end
     
   end  
-end
\ No newline at end of file
+end</diff>
      <filename>lib/facebooker/logging.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,12 +3,12 @@ module Facebooker
     def initialize(session)
       @session = session
     end
-  
+
     # Used to determine whether the user identified by &quot;uid&quot; has enabled SMS for this application.
     def can_send(user)
       @session.post('facebook.sms.canSend', :uid =&gt; User.cast_to_facebook_id(user))
     end
-    
+
     # Send the given message to the user.
     # See http://wiki.developers.facebook.com/index.php/Mobile
     def send(user, message)</diff>
      <filename>lib/facebooker/mobile.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 module Facebooker
   ##
-  # helper methods primarily supporting the management of Ruby objects which are populatable via Hashes.  
+  # helper methods primarily supporting the management of Ruby objects which are populatable via Hashes.
   # Since most Facebook API calls accept and return hashes of data (as XML), the Model module allows us to
   # directly populate a model's attributes given a Hash with matching key names.
   module Model
@@ -19,15 +19,15 @@ module Facebooker
         yield instance if block_given?
         instance
       end
-      
+
       ##
-      # Create a standard attr_writer and a populating_attr_reader      
+      # Create a standard attr_writer and a populating_attr_reader
       def populating_attr_accessor(*symbols)
-        attr_writer *symbols
-        populating_attr_reader *symbols
+        attr_writer(*symbols)
+        populating_attr_reader(*symbols)
       end
 
-      ## 
+      ##
       # Create a reader that will attempt to populate the model if it has not already been populated
       def populating_attr_reader(*symbols)
         symbols.each do |symbol|
@@ -59,27 +59,29 @@ module Facebooker
       def hash_settable_writer(symbol, klass)
         define_method(&quot;#{symbol}=&quot;) do |value|
           instance_variable_set(&quot;@#{symbol}&quot;, value.kind_of?(Hash) ? klass.from_hash(value) : value)
-        end        
+        end
       end
       
       #
       # Declares an attribute named ::symbol:: which can be set with either a list of instances of ::klass::
-      # or a list of Hashes which will be used to populate a new instance of ::klass::.      
+      # or a list of Hashes which will be used to populate a new instance of ::klass::.
       def hash_settable_list_accessor(symbol, klass)
         attr_reader symbol
         hash_settable_list_writer(symbol, klass)
       end
-      
+
       def hash_settable_list_writer(symbol, klass)
         define_method(&quot;#{symbol}=&quot;) do |list|
           instance_variable_set(&quot;@#{symbol}&quot;, list.map do |item|
             item.kind_of?(Hash) ? klass.from_hash(item) : item
           end)
         end
-      end      
+      end
 
       def id_is(attribute)
-        class_eval &lt;&lt;-EOS
+        (file, line) = caller.first.split(':')
+
+        class_eval(&lt;&lt;-EOS, file, line.to_i)
         def #{attribute}=(value)
           @#{attribute} = value.to_i
         end
@@ -90,7 +92,7 @@ module Facebooker
         EOS
       end
     end
-    
+
     ##
     # Centralized, error-checked place for a model to get the session to which it is bound.
     # Any Facebook API queries require a Session instance.
@@ -113,7 +115,7 @@ module Facebooker
     end
 
     def populated?
-      !@populated.nil?
+      @populated
     end
     
     ##</diff>
      <filename>lib/facebooker/model.rb</filename>
    </modified>
    <modified>
      <diff>@@ -33,7 +33,7 @@ module Facebooker
                :private_install, :installable, :privacy_url, :help_url, :see_all_url, :tos_url,
                :dev_mode, :preload_fql, :icon_url, :canvas_name, :logo_url, :connect_logo_url ]
     
-    attr_accessor *FIELDS
+    attr_accessor(*FIELDS)
          
   end
 end</diff>
      <filename>lib/facebooker/models/applicationproperties.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,8 +3,8 @@ module Facebooker
   class ApplicationRestrictions
     include Model
     FIELDS = [ :age, :location, :age_distribution, :type ]
-    
-    attr_accessor *FIELDS
-         
+
+    attr_accessor(*FIELDS)
+
   end
 end</diff>
      <filename>lib/facebooker/models/applicationrestrictions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -21,8 +21,8 @@ module Facebooker
     end
     
     include Model
-    attr_accessor :eid, :pic, :pic_small, :pic_big, :name, :creator, :update_time, :description, :tagline, :venue, :host, :event_type, :nid, :location, :end_time, :start_time, :event_subtype
+    attr_accessor :pic, :pic_small, :pic_big, :name, :creator, :update_time, :description, :tagline, :venue, :host, :event_type, :nid, :location, :end_time, :start_time, :event_subtype
 
     id_is :eid
   end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/facebooker/models/event.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,8 +4,8 @@ module Facebooker
   # A simple representation of a friend list.
   class FriendList
     include Model
-    attr_accessor :flid, :name
-    
+    attr_accessor :name
+
     id_is :flid
 
     # We need this to be an integer, so do the conversion</diff>
      <filename>lib/facebooker/models/friend_list.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,10 +8,10 @@ module Facebooker
       attr_accessor :position, :gid, :uid
     end
     include Model
-    attr_accessor :pic, :pic_small, :pic_big, :name, :creator, :recent_news, :gid, :update_time, :group_subtype, :group_type, :website, :office, :description, :venue, :nid
-    
+    attr_accessor :pic, :pic_small, :pic_big, :name, :creator, :recent_news, :update_time, :group_subtype, :group_type, :website, :office, :description, :venue, :nid
+
     id_is :gid
-    
+
     ##
     # Get the full list of members as populated User objects.  First time fetches group members via Facebook API call.  
     # Subsequent calls return cached values.
@@ -33,4 +33,4 @@ module Facebooker
       end
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/facebooker/models/group.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@ module Facebooker
     class Genre
       include Model
       FIELDS = [ :dance, :party, :relax, :talk, :think, :workout, :sing, :intimate, :raunchy, :headphones ]
-      attr_accessor *FIELDS
+      attr_accessor(*FIELDS)
 
       def initialize(*args)
         super
@@ -18,7 +18,8 @@ module Facebooker
     end
 
     include Model
-    attr_accessor :page_id, :name, :pic_small, :pic_big, :pic_square, :pic_large, :type, :type, :website, :location, :hours, :band_members, :bio, :hometown, :genre, :record_label, :influences, :has_added_app, :founded, :company_overview, :mission, :products, :release_date, :starring, :written_by, :directed_by, :produced_by, :studio, :awards, :plot_outline, :network, :season, :schedule
+    attr_accessor :page_id, :name, :pic_small, :pic_big, :pic_square, :pic_large, :type, :type, :website, :location, :hours, :band_members, :bio, :hometown, :record_label, :influences, :has_added_app, :founded, :company_overview, :mission, :products, :release_date, :starring, :written_by, :directed_by, :produced_by, :studio, :awards, :plot_outline, :network, :season, :schedule
+    attr_reader :genre
 
     def genre=(value)
       @genre = value.kind_of?(Hash) ? Genre.from_hash(value) : value</diff>
      <filename>lib/facebooker/models/page.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,11 +2,11 @@ require 'facebooker/model'
 module Facebooker
   class Photo
     include Model
-    attr_accessor :pid, :aid, :owner, :title,
+    attr_accessor :aid, :owner, :title,
                   :link, :caption, :created,
                   :src, :src_big, :src_small,
                   :story_fbid
 
     id_is :pid
   end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/facebooker/models/photo.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,23 +10,30 @@ module Facebooker
       include Model
       attr_accessor :message, :time, :status_id
     end
-    FIELDS = [:status, :political, :pic_small, :name, :quotes, :is_app_user, :tv, :profile_update_time, :meeting_sex, :hs_info, :timezone, :relationship_status, :hometown_location, :about_me, :wall_count, :significant_other_id, :pic_big, :music, :uid, :work_history, :sex, :religion, :notes_count, :activities, :pic_square, :movies, :has_added_app, :education_history, :birthday, :first_name, :meeting_for, :last_name, :interests, :current_location, :pic, :books, :affiliations, :locale, :profile_url, :proxied_email, :email_hashes, :allowed_restrictions, :pic_with_logo, :pic_big_with_logo, :pic_small_with_logo, :pic_square_with_logo]
+    FIELDS = [:political, :pic_small, :name, :quotes, :is_app_user, :tv, :profile_update_time, :meeting_sex, :hs_info, :timezone, :relationship_status, :hometown_location, :about_me, :wall_count, :significant_other_id, :pic_big, :music, :work_history, :sex, :religion, :notes_count, :activities, :pic_square, :movies, :has_added_app, :education_history, :birthday, :first_name, :meeting_for, :last_name, :interests, :current_location, :pic, :books, :affiliations, :locale, :profile_url, :proxied_email, :email_hashes, :allowed_restrictions, :pic_with_logo, :pic_big_with_logo, :pic_small_with_logo, :pic_square_with_logo]
     STANDARD_FIELDS = [:uid, :first_name, :last_name, :name, :timezone, :birthday, :sex, :affiliations, :locale, :profile_url, :pic_square]
-    populating_attr_accessor *FIELDS
+    populating_attr_accessor(*FIELDS)
     attr_reader :affiliations
     populating_hash_settable_accessor :current_location, Location
     populating_hash_settable_accessor :hometown_location, Location
     populating_hash_settable_accessor :hs_info, EducationInfo::HighschoolInfo
-    populating_hash_settable_accessor :status, Status
     populating_hash_settable_list_accessor :affiliations, Affiliation
     populating_hash_settable_list_accessor :education_history, EducationInfo
     populating_hash_settable_list_accessor :work_history, WorkInfo
-    
+
+    populating_attr_reader :status
+
     # Can pass in these two forms:
     # id, session, (optional) attribute_hash
     # attribute_hash
     def initialize(*args)
-      @friends = nil
+      @friends            = nil
+      @current_location   = nil
+      @pic                = nil
+      @hometown_location  = nil
+      @populated          = false
+      @session            = nil
+      @id                 = nil
       if (args.first.kind_of?(String) || args.first.kind_of?(Integer)) &amp;&amp; args.size==1
         self.uid = args.shift
         @session = Session.current
@@ -36,7 +43,7 @@ module Facebooker
       end
       if args.last.kind_of?(Hash)
         populate_from_hash!(args.pop)
-      end     
+      end
     end
 
     id_is :uid</diff>
      <filename>lib/facebooker/models/user.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,10 @@
 module Facebooker
   class WorkInfo
     include Model
-    attr_accessor :end_date, :start_date, :company_name, :description, :position, :location
+    attr_accessor :end_date, :start_date, :company_name, :description, :position
+    attr_reader :location
     def location=(location)
       @location = location.kind_of?(Hash) ? Location.from_hash(location) : location
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/facebooker/models/work_info.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,7 +12,12 @@ module Facebooker
         controller.helper_method :request_comes_from_facebook?
       end
 
-    
+      def initialize *args
+        @facebook_session       = nil
+        @installation_required  = nil
+        super
+      end
+
       def facebook_session
         @facebook_session
       end</diff>
      <filename>lib/facebooker/rails/controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,11 +8,11 @@ module ::ActionController
       end
       request_method_without_facebooker
     end
-    
+
     if new.methods.include?(&quot;request_method&quot;)
-      alias_method_chain :request_method, :facebooker 
+      alias_method_chain :request_method, :facebooker
     end
-    
+
     def xml_http_request_with_facebooker?
       parameters[&quot;fb_sig_is_mockajax&quot;] == &quot;1&quot;  ||
       parameters[&quot;fb_sig_is_ajax&quot;] == &quot;1&quot; ||
@@ -20,7 +20,9 @@ module ::ActionController
     end
     alias_method_chain :xml_http_request?, :facebooker
     # we have to re-alias xhr? since it was pointing to the old method
-    alias xhr? :xml_http_request?
-    
+    unless defined? :xhr?
+      alias xhr? :xml_http_request?
+    end
+
   end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/facebooker/rails/facebook_request_fix.rb</filename>
    </modified>
    <modified>
      <diff>@@ -24,7 +24,6 @@ end
 
 class CGI  
   class Session
-    private
       alias :initialize_aliased_by_facebooker :initialize
       attr_reader :request, :initialization_options
 
@@ -66,4 +65,4 @@ class CGI
         @session_id || create_new_id_aliased_by_facebooker
       end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/facebooker/rails/facebook_session_handling.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,35 +1,38 @@
 module ::ActionController
   if Rails.version &lt; '2.3'
-    class AbstractRequest                         
+    class AbstractRequest
       def relative_url_root
         Facebooker.path_prefix
-      end                                         
+      end
     end
   else
-    class Request                         
+    class Request
       def relative_url_root
         Facebooker.path_prefix
-      end                                         
+      end
     end
   end
-  
+
   class Base
-    def self.relative_url_root
-      Facebooker.path_prefix
+    class &lt;&lt; self
+      alias :old_relative_url_root :relative_url_root
+      def relative_url_root
+        Facebooker.path_prefix
+      end
     end
-  end  
-  
+  end
+
   class UrlRewriter
     RESERVED_OPTIONS &lt;&lt; :canvas
     def link_to_new_canvas?
-      @request.parameters[&quot;fb_sig_in_new_facebook&quot;] == &quot;1&quot; 
+      @request.parameters[&quot;fb_sig_in_new_facebook&quot;] == &quot;1&quot;
     end
     def link_to_canvas?(params, options)
       option_override = options[:canvas]
       return false if option_override == false # important to check for false. nil should use default behavior
       option_override || (can_safely_access_request_parameters? &amp;&amp; (@request.parameters[&quot;fb_sig_in_canvas&quot;] == &quot;1&quot; ||  @request.parameters[:fb_sig_in_canvas] == &quot;1&quot; ))
     end
-    
+
     #rails blindly tries to merge things that may be nil into the parameters. Make sure this won't break
     def can_safely_access_request_parameters?
       @request.request_parameters</diff>
      <filename>lib/facebooker/rails/facebook_url_rewriting.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,16 +1,17 @@
 require 'action_pack'
+
 module Facebooker
   module Rails
-    
+
     # Facebook specific helpers for creating FBML
     # 
     # All helpers that take a user as a parameter will get the Facebook UID from the facebook_id attribute if it exists.
     # It will use to_s if the facebook_id attribute is not present.
     #
     module Helpers
-      
+
       include Facebooker::Rails::Helpers::FbConnect
-      
+
       # Create an fb:dialog
       # id must be a unique name e.g. &quot;my_dialog&quot;
       # cancel_button is true or false</diff>
      <filename>lib/facebooker/rails/helpers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -88,31 +88,32 @@ module Facebooker
     #
     # Publisher makes many helpers available, including the linking and asset helpers
     class Publisher
-      
+
       #story sizes from the Facebooker API
       ONE_LINE=1
       SHORT=2
       FULL=4
-      
+
       def initialize
-        @controller = PublisherController.new        
+        @from                 = nil
+        @full_story_template  = nil
+        @recipients           = nil
+        @controller           = PublisherController.new
       end
-      
+
       # use facebook options everywhere
       def request_comes_from_facebook?
         true
       end
-      
+
       class FacebookTemplate &lt; ::ActiveRecord::Base
-        
-        
         cattr_accessor :template_cache
         self.template_cache = {}
-        
+
         def self.inspect(*args)
           &quot;FacebookTemplate&quot;
         end
-        
+
         def template_changed?(hash)
           if respond_to?(:content_hash)
             content_hash != hash 
@@ -180,20 +181,21 @@ module Facebooker
                (publisher.full_story_template and publisher.full_story_template.to_a.sort_by{|e| e[0].to_s})
                ].to_json
           end
-          
+
           def template_name(klass,method)
             &quot;#{klass.name}::#{method}&quot;
           end
         end
       end
-      
+
       class_inheritable_accessor :master_helper_module
-      attr_accessor :one_line_story_templates, :short_story_templates, :action_links
-      
+      attr_accessor :one_line_story_templates, :short_story_templates
+      attr_writer :action_links
+
       cattr_accessor :skip_registry
       self.skip_registry = false
-      
-      
+
+
       class InvalidSender &lt; StandardError; end
       class UnknownBodyType &lt; StandardError; end
       class UnspecifiedBodyType &lt; StandardError; end
@@ -219,20 +221,21 @@ module Facebooker
       end
       class UserAction
         attr_accessor :data
-        attr_accessor :target_ids
+        attr_reader   :target_ids
         attr_accessor :body_general
         attr_accessor :template_id
         attr_accessor :template_name
         attr_accessor :story_size
-        
+
         def target_ids=(val)
           @target_ids = val.is_a?(Array) ? val.join(&quot;,&quot;) : val
         end
+
         def data_hash
           data||{}
         end
       end
-      
+
       cattr_accessor :ignore_errors
       attr_accessor :_body
 
@@ -288,12 +291,12 @@ module Facebooker
         @one_line_story_templates ||= []
         @one_line_story_templates &lt;&lt; str
       end
-      
+
       def short_story_template(title,body,params={})
         @short_story_templates ||= []
         @short_story_templates &lt;&lt; params.merge(:template_title=&gt;title, :template_body=&gt;body)
       end
-      
+
       def action_links(*links)
         if links.blank?
           @action_links
@@ -493,38 +496,41 @@ module Facebooker
           args.each do |arg|
             case arg
             when Symbol,String
-              add_template_helper(&quot;#{arg.to_s.classify}Helper&quot;.constantize)              
+              add_template_helper(&quot;#{arg.to_s.classify}Helper&quot;.constantize)
             when Module
               add_template_helper(arg)
             end
           end
         end
-        
+
         def add_template_helper(helper_module) #:nodoc:
           master_helper_module.send :include,helper_module
           include master_helper_module
         end
 
-    
+
         def inherited(child)
-          super          
+          super
           child.master_helper_module=Module.new
           child.master_helper_module.__send__(:include,self.master_helper_module)
           child.send(:include, child.master_helper_module)
           FacebookTemplate.clear_cache!
         end
-    
+
       end
       class PublisherController
         include Facebooker::Rails::Publisher.master_helper_module
         include ActionController::UrlWriter
-        
-        def self.default_url_options(*args)
-          Facebooker::Rails::Publisher.default_url_options(*args)
+
+        class &lt;&lt; self
+          alias :old_default_url_options :default_url_options
+          def default_url_options(*args)
+            Facebooker::Rails::Publisher.default_url_options(*args)
+          end
         end
-        
+
       end
-      
+
     end
   end
 end</diff>
      <filename>lib/facebooker/rails/publisher.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ module Facebooker
   # other than the logged in user (if that's unallowed)
   class NonSessionUser &lt; StandardError;  end
   class Session
-    
+
     #
     # Raised when a facebook session has expired.  This 
     # happens when the timeout is reached, or when the
@@ -62,49 +62,49 @@ module Facebooker
     class UserRegistrationFailed &lt; StandardError
       attr_accessor :failed_users
     end
-    
+
     API_SERVER_BASE_URL       = ENV[&quot;FACEBOOKER_API&quot;] == &quot;new&quot; ? &quot;api.new.facebook.com&quot; : &quot;api.facebook.com&quot;
     API_PATH_REST             = &quot;/restserver.php&quot;
     WWW_SERVER_BASE_URL       = ENV[&quot;FACEBOOKER_API&quot;] == &quot;new&quot; ? &quot;www.new.facebook.com&quot; : &quot;www.facebook.com&quot;
     WWW_PATH_LOGIN            = &quot;/login.php&quot;
     WWW_PATH_ADD              = &quot;/add.php&quot;
     WWW_PATH_INSTALL          = &quot;/install.php&quot;
-    
+
     attr_writer :auth_token
     attr_reader :session_key
-    
+
     def self.create(api_key=nil, secret_key=nil)
       api_key ||= self.api_key
       secret_key ||= self.secret_key
       raise ArgumentError unless !api_key.nil? &amp;&amp; !secret_key.nil?
       new(api_key, secret_key)
     end
-    
+
     def self.api_key
       extract_key_from_environment(:api) || extract_key_from_configuration_file(:api) rescue report_inability_to_find_key(:api)
     end
-    
+
     def self.secret_key
       extract_key_from_environment(:secret) || extract_key_from_configuration_file(:secret) rescue report_inability_to_find_key(:secret)
     end
-    
+
     def self.current
       Thread.current['facebook_session']
     end
-    
+
     def self.current=(session)
       Thread.current['facebook_session'] = session
     end
-    
+
     def login_url(options={})
       options = default_login_url_options.merge(options)
       &quot;#{Facebooker.login_url_base(@api_key)}#{login_url_optional_parameters(options)}&quot;
     end
-    
+
     def install_url(options={})
       &quot;#{Facebooker.install_url_base(@api_key)}#{install_url_optional_parameters(options)}&quot;
     end
-    
+
     # The url to get user to approve extended permissions
     # http://wiki.developers.facebook.com/index.php/Extended_permission
     #
@@ -122,20 +122,20 @@ module Facebooker
       options = default_login_url_options.merge(options)
       &quot;http://#{Facebooker.www_server_base_url}/authorize.php?api_key=#{@api_key}&amp;v=1.0&amp;ext_perm=#{permission}#{install_url_optional_parameters(options)}&quot;
     end
-    
+
     def install_url_optional_parameters(options)
       optional_parameters = []      
       optional_parameters += add_next_parameters(options)
       optional_parameters.join
     end
-    
+
     def add_next_parameters(options)
       opts = []
       opts &lt;&lt; &quot;&amp;next=#{CGI.escape(options[:next])}&quot; if options[:next]
       opts &lt;&lt; &quot;&amp;next_cancel=#{CGI.escape(options[:next_cancel])}&quot; if options[:next_cancel]
       opts
     end
-    
+
     def login_url_optional_parameters(options)
       # It is important that unused options are omitted as stuff like &amp;canvas=false will still display the canvas. 
       optional_parameters = []
@@ -145,50 +145,54 @@ module Facebooker
       optional_parameters &lt;&lt; &quot;&amp;canvas=true&quot; if options[:canvas]
       optional_parameters.join
     end
-    
+
     def default_login_url_options
       {}
     end
-    
+
     def initialize(api_key, secret_key)
-      @api_key = api_key
-      @secret_key = secret_key
-      @batch_request = nil
-      @session_key = nil
+      @api_key        = api_key
+      @secret_key     = secret_key
+      @batch_request  = nil
+      @session_key    = nil
+      @uid            = nil
+      @auth_token     = nil
+      @secret_from_session = nil
+      @expires        = nil
     end
-    
+
     def secret_for_method(method_name)
       @secret_key
     end
-      
+
     def auth_token
       @auth_token ||= post 'facebook.auth.createToken'
     end
-    
+
     def infinite?
       @expires == 0
     end
-    
+
     def expired?
       @expires.nil? || (!infinite? &amp;&amp; Time.at(@expires) &lt;= Time.now)
     end
-    
+
     def secured?
       !@session_key.nil? &amp;&amp; !expired?
     end
-    
+
     def secure!
       response = post 'facebook.auth.getSession', :auth_token =&gt; auth_token
       secure_with!(response['session_key'], response['uid'], response['expires'], response['secret'])
     end    
-    
+
     def secure_with!(session_key, uid = nil, expires = nil, secret_from_session = nil)
       @session_key = session_key
       @uid = uid ? Integer(uid) : post('facebook.users.getLoggedInUser', :session_key =&gt; session_key)
       @expires = Integer(expires)
       @secret_from_session = secret_from_session
     end
-    
+
     def fql_query(query, format = 'XML')
       post('facebook.fql.query', :query =&gt; query, :format =&gt; format) do |response|
         type = response.shift
@@ -214,11 +218,11 @@ module Facebooker
         end
       end
     end
-    
+
     def user
       @user ||= User.new(uid, self)
     end
-    
+
     #
     # This one has so many parameters, a Hash seemed cleaner than a long param list.  Options can be:
     # :uid =&gt; Filter by events associated with a user with this uid
@@ -233,7 +237,7 @@ module Facebooker
         end
       end
     end
-    
+
     def event_members(eid)
       @members ||= post('facebook.events.getMembers', :eid =&gt; eid) do |response|
         response.map do |attendee_hash|
@@ -275,21 +279,21 @@ module Facebooker
     def server_cache
       Facebooker::ServerCache.new(self)
     end
-    
+
     #
     # Returns a proxy object for handling calls to the Facebook Data API
     def data
       Facebooker::Data.new(self)
     end
-    
+
     def admin
       Facebooker::Admin.new(self)
     end
-    
+
     def mobile
       Facebooker::Mobile.new(self)
     end
-    
+
     #
     # Given an array like:
     # [[userid, otheruserid], [yetanotherid, andanotherid]]
@@ -305,7 +309,7 @@ module Facebooker
       end
       post('facebook.friends.areFriends', :uids1 =&gt; uids1.join(','), :uids2 =&gt; uids2.join(','))
     end
-    
+
     def get_photos(pids = nil, subj_id = nil,  aid = nil)
       if [subj_id, pids, aid].all? {|arg| arg.nil?}
         raise ArgumentError, &quot;Can't get a photo without a picture, album or subject ID&quot; 
@@ -316,7 +320,7 @@ module Facebooker
         end
       end
     end
-    
+
     def get_albums(aids)
       @albums = post('facebook.photos.getAlbums', :aids =&gt; aids) do |response|
         response.map do |hash|        
@@ -324,7 +328,7 @@ module Facebooker
         end
       end
     end
-    
+
     def get_tags(pids)
       @tags = post('facebook.photos.getTags', :pids =&gt; pids)  do |response|
         response.map do |hash|
@@ -332,14 +336,14 @@ module Facebooker
         end
       end
     end
-    
+
     def add_tags(pid, x, y, tag_uid = nil, tag_text = nil )
       if [tag_uid, tag_text].all? {|arg| arg.nil?}
         raise ArgumentError, &quot;Must enter a name or string for this tag&quot;        
       end
       @tags = post('facebook.photos.addTag', :pid =&gt; pid, :tag_uid =&gt; tag_uid, :tag_text =&gt; tag_text, :x =&gt; x, :y =&gt; y )
     end
-    
+
     def send_notification(user_ids, fbml, email_fbml = nil)
       params = {:notification =&gt; fbml, :to_ids =&gt; user_ids.map{ |id| User.cast_to_facebook_id(id)}.join(',')}
       if email_fbml
@@ -350,25 +354,25 @@ module Facebooker
       unless uid?
         params[:type]=&quot;app_to_user&quot;
       end
-      
+
       post 'facebook.notifications.send', params,uid?
     end 
-    
+
     ##
     # Register a template bundle with Facebook.
     # returns the template id to use to send using this template
     def register_template_bundle(one_line_story_templates,short_story_templates=nil,full_story_template=nil, action_links=nil)
       parameters = {:one_line_story_templates =&gt; Array(one_line_story_templates).to_json}
-      
+
       parameters[:action_links] = action_links.to_json unless action_links.blank?
-      
+
       parameters[:short_story_templates] = Array(short_story_templates).to_json unless short_story_templates.blank?
 
       parameters[:full_story_template] = full_story_template.to_json unless full_story_template.blank?
 
       post(&quot;facebook.feed.registerTemplateBundle&quot;, parameters, false)
     end
-    
+
     ##
     # publish a previously rendered template bundle
     # see http://wiki.developers.facebook.com/index.php/Feed.publishUserAction
@@ -380,8 +384,8 @@ module Facebooker
       parameters[:story_size] = story_size unless story_size.nil?
       post(&quot;facebook.feed.publishUserAction&quot;, parameters)
     end
-    
-    
+
+
     ##
     # Send email to as many as 100 users at a time
     def send_email(user_ids, subject, text, fbml = nil) 			
@@ -389,17 +393,17 @@ module Facebooker
       params = {:fbml =&gt; fbml, :recipients =&gt; user_ids.map{ |id| User.cast_to_facebook_id(id)}.join(','), :text =&gt; text, :subject =&gt; subject} 
       post 'facebook.notifications.sendEmail', params
     end
-    
+
     # Only serialize the bare minimum to recreate the session.
     def marshal_load(variables)#:nodoc:
       fields_to_serialize.each_with_index{|field, index| instance_variable_set_value(field, variables[index])}
     end
-    
+
     # Only serialize the bare minimum to recreate the session.    
     def marshal_dump#:nodoc:
       fields_to_serialize.map{|field| instance_variable_value(field)}
     end
-    
+
     # Only serialize the bare minimum to recreate the session. 
     def to_yaml( opts = {} )
       YAML::quick_emit(self.object_id, opts) do |out|
@@ -410,29 +414,29 @@ module Facebooker
         end
       end
     end
-    
+
     def instance_variable_set_value(field, value)
       self.instance_variable_set(&quot;@#{field}&quot;, value)
     end
-    
+
     def instance_variable_value(field)
       self.instance_variable_get(&quot;@#{field}&quot;)
     end
-    
+
     def fields_to_serialize
       %w(session_key uid expires secret_from_session auth_token api_key secret_key)
     end
-    
+
     class Desktop &lt; Session
       def login_url
         super + &quot;&amp;auth_token=#{auth_token}&quot;
       end
-      
+
       def secret_for_method(method_name)
         secret = auth_request_methods.include?(method_name) ? super : @secret_from_session
         secret
       end
-      
+
       def post(method, params = {},use_session=false)
         if method == 'facebook.profile.getFBML' || method == 'facebook.profile.setFBML'
           raise NonSessionUser.new(&quot;User #{@uid} is not the logged in user.&quot;) unless @uid == params[:uid]
@@ -444,17 +448,17 @@ module Facebooker
           ['facebook.auth.getSession', 'facebook.auth.createToken']
         end
     end
-    
+
     def batch_request?
       @batch_request
     end
-    
+
     def add_to_batch(req,&amp;proc)
       batch_request = BatchRequest.new(req,proc)
       Thread.current[:facebooker_current_batch_queue]&lt;&lt;batch_request
       batch_request
     end
-    
+
     # Submit the enclosed requests for this session inside a batch
     # 
     # All requests will be sent to Facebook at the end of the block
@@ -502,7 +506,7 @@ module Facebooker
       @batch_request=false
       BatchRun.current_batch=nil
     end
-    
+
     def post_without_logging(method, params = {}, use_session_key = true, &amp;proc)
       add_facebook_params(params, method)
       use_session_key &amp;&amp; @session_key &amp;&amp; params[:session_key] ||= @session_key
@@ -515,7 +519,7 @@ module Facebooker
         result
       end
     end
-    
+
     def post(method, params = {}, use_session_key = true, &amp;proc)
       if batch_request?
         post_without_logging(method, params, use_session_key, &amp;proc)
@@ -525,7 +529,7 @@ module Facebooker
         end
       end
     end
-    
+
     def post_file(method, params = {})
       base = params.delete(:base)
       Logging.log_fb_api(method, params) do
@@ -534,16 +538,18 @@ module Facebooker
         service.post_file(params.merge(:base =&gt; base, :sig =&gt; signature_for(params.reject{|key, value| key.nil?})))
       end
     end
-    
-    
+
+
+    @configuration_file_path = nil
+
     def self.configuration_file_path
       @configuration_file_path || File.expand_path(&quot;~/.facebookerrc&quot;)
     end
-    
+
     def self.configuration_file_path=(path)
       @configuration_file_path = path
     end
-    
+
     private
       def add_facebook_params(hash, method)
         hash[:method] = method
@@ -551,36 +557,36 @@ module Facebooker
         hash[:call_id] = Time.now.to_f.to_s unless method == 'facebook.auth.getSession'
         hash[:v] = &quot;1.0&quot;
       end
-      
+
       # This ultimately delgates to the adapter
       def self.extract_key_from_environment(key_name)
              Facebooker.send(key_name.to_s + &quot;_key&quot;) rescue nil
       end
-      
+
       def self.extract_key_from_configuration_file(key_name)
         read_configuration_file[key_name]
       end
-      
+
       def self.report_inability_to_find_key(key_name)
         raise ConfigurationMissing, &quot;Could not find configuration information for #{key_name}&quot;
       end
-      
+
       def self.read_configuration_file
         eval(File.read(configuration_file_path))
       end
-      
+
       def service
         @service ||= Service.new(Facebooker.api_server_base, Facebooker.api_rest_path, @api_key)      
       end
-      
+
       def uid
         @uid || (secure!; @uid)
       end
-      
+
       def uid?
         !! @uid
       end
-      
+
       def signature_for(params)
         raw_string = params.inject([]) do |collection, pair|
           collection &lt;&lt; pair.join(&quot;=&quot;)
@@ -589,7 +595,7 @@ module Facebooker
         Digest::MD5.hexdigest([raw_string, secret_for_method(params[:method])].join)
       end
   end
-  
+
   class CanvasSession &lt; Session
     def default_login_url_options
       {:canvas =&gt; true}</diff>
      <filename>lib/facebooker/session.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,46 +1,48 @@
 require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
 
-class Facebooker::SessionTest &lt; Test::Unit::TestCase
+class Facebooker::AdaptersTest &lt; Test::Unit::TestCase
   def setup
     ENV['FACEBOOK_API_KEY'] = '1234567'
-    ENV['FACEBOOK_SECRET_KEY'] = '7654321'   
-    Facebooker.current_adapter = nil 
-    @bebo_api_key = &quot;bebo_api_key&quot;; @bebo_secret_key = &quot;bebo_secret_key&quot;    
+    ENV['FACEBOOK_SECRET_KEY'] = '7654321'
+    @current_adapter = Facebooker.current_adapter
+    Facebooker.current_adapter = nil
+    @bebo_api_key = &quot;bebo_api_key&quot;; @bebo_secret_key = &quot;bebo_secret_key&quot;
   end
 
   def teardown
    flexmock_close
+    Facebooker.current_adapter = @current_adapter
   end
-  
+
   def test_load_default_adapter
     session = Facebooker::CanvasSession.create(ENV['FACEBOOK_API_KEY'], ENV['FACEBOOK_SECRET_KEY'])
     assert_equal(ENV['FACEBOOK_API_KEY'], Facebooker::Session.api_key)
     assert( Facebooker::FacebookAdapter === Facebooker.current_adapter)
-    
+
     ENV['FACEBOOK_API_KEY'] = nil
-    ENV['FACEBOOK_SECRET_KEY'] = nil   
-    Facebooker.current_adapter = nil 
+    ENV['FACEBOOK_SECRET_KEY'] = nil
+    Facebooker.current_adapter = nil
     Facebooker::AdapterBase.stubs(:facebooker_config).returns({&quot;api_key&quot; =&gt; &quot;facebook_key&quot;, &quot;secret_key&quot; =&gt; &quot;facebook_secret&quot; })
     assert( Facebooker::FacebookAdapter === Facebooker.current_adapter)
     assert_equal(&quot;facebook_key&quot;, Facebooker::Session.api_key)
   end
-  
+
   def test_load_bebo_adapter
-   
+
     load_bebo_adapter
     assert_equal(@bebo_api_key, Facebooker::Session.api_key)
     assert_equal(@bebo_secret_key, Facebooker::Session.secret_key)
     assert(Facebooker::BeboAdapter === Facebooker.current_adapter, &quot; Bebo adapter not loaded correctly.&quot;)
   end
-  
+
   def load_bebo_adapter
-    @bebo_api_key = &quot;bebo_api_key&quot;; @bebo_secret_key = &quot;bebo_secret_key&quot;    
+    @bebo_api_key = &quot;bebo_api_key&quot;; @bebo_secret_key = &quot;bebo_secret_key&quot;
 
     Facebooker::AdapterBase.stubs(:facebooker_config).returns({&quot;bebo_api_key&quot; =&gt; @bebo_api_key, &quot;bebo_adapter&quot; =&gt; &quot;BeboAdapter&quot;, &quot;bebo_secret_key&quot; =&gt; @bebo_secret_key, &quot;foo&quot; =&gt; &quot;bar&quot;})
     Facebooker.load_adapter(:config_key_base =&gt; &quot;bebo&quot;)
     @session = Facebooker::CanvasSession.create(@bebo_api_key, @bebo_secret_key)
   end
-  
+
   def test_adapter_details
      test_load_default_adapter
 
@@ -50,7 +52,7 @@ class Facebooker::SessionTest &lt; Test::Unit::TestCase
      assert_equal(&quot;http://api.facebook.com&quot;, Facebooker.api_server_base_url)
      assert(Facebooker.is_for?(:facebook))
     load_bebo_adapter
-    
+
       assert_equal(&quot;apps.bebo.com&quot;, Facebooker.canvas_server_base)
      assert_equal(&quot;apps.bebo.com&quot;, Facebooker.api_server_base)
      assert_equal(&quot;www.bebo.com&quot;, Facebooker.www_server_base_url)
@@ -58,20 +60,20 @@ class Facebooker::SessionTest &lt; Test::Unit::TestCase
      assert_equal(&quot;http://www.bebo.com/SignIn.jsp?ApiKey=bebo_api_key&amp;v=1.0&amp;canvas=true&quot;, @session.login_url)
      assert_equal(&quot;http://www.bebo.com/c/apps/add?ApiKey=bebo_api_key&amp;v=1.0&quot;, @session.install_url)
      assert(Facebooker.is_for?(:bebo))
-     
+
   end
-  
+
   def test_adapter_failures
       Facebooker::AdapterBase.stubs(:facebooker_config).returns({})
-      
+
       assert_raises(Facebooker::AdapterBase::UnableToLoadAdapter){
         Facebooker.load_adapter(:config_key_base =&gt; &quot;bebo&quot;)
       }
   end
-  
+
   def test_bebo_specific_issues
     load_bebo_adapter
-     
+
     # @session.send(:service).stubs(:post).returns([{:name =&gt; &quot;foo&quot;}])
      Net::HTTP.stubs(:post_form).returns(&quot;&lt;profile_setFBML_response&gt;&lt;/profile_setFBML_response&gt;&quot;)
      user = Facebooker::User.new(:uid =&gt; &quot;123456&quot;)
@@ -87,10 +89,8 @@ class Facebooker::SessionTest &lt; Test::Unit::TestCase
      Net::HTTP.stubs(:post_form).returns(&quot;&lt;feed_publishTemplatizedAction_response&gt;1&lt;/feed_publishTemplatizedAction_response&gt;&quot;)
      user.publish_templatized_action(action)
   end
-  
+
   def test_bebo_process_data
-    
-  end
-  
 
+  end
 end</diff>
      <filename>test/facebooker/adapters_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,11 +12,21 @@ class Facebooker::ModelTest &lt; Test::Unit::TestCase
     attr_accessor :name, :job
     hash_settable_accessor :complex_thing, ComplexThing
     hash_settable_list_accessor :list_of_complex_things, ComplexThing
+
+    def initialize *args
+      @session = nil
+      super
+    end
   end
 
   class PopulatingThing
     include Facebooker::Model
     populating_attr_accessor :first_name
+
+    def initialize
+      @first_name = nil
+      @populated  = false
+    end
   end
   
   def test_can_instantiate_an_object_with_a_hash</diff>
      <filename>test/facebooker/model_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,32 +11,32 @@ module ModuleHelper
     true
   end
 end
- 
+
 ::RAILS_DEFAULT_LOGGER = Logger.new(STDOUT)
 
 class TestPublisher &lt; Facebooker::Rails::Publisher
-  
+
   helper :symbol
   helper ModuleHelper
-  
+
   def action(f)
     send_as :action
     from f
     title &quot;Action Title&quot;
   end
-  
+
   def templatized_action(f)
     send_as :templatized_action
     from f
     title_template &quot;Templatized Action Title&quot;
   end
-  
+
   def story(to)
     send_as :story
     recipients to
     title 'Story Title'
   end
-  
+
   def notification(to,f)
     send_as :notification
     recipients to
@@ -52,24 +52,24 @@ class TestPublisher &lt; Facebooker::Rails::Publisher
     fbml 'text'
     text fbml
   end
-  
+
   def render_notification(to,f)
     send_as :notification
     recipients to
     from f
     fbml render(:inline=&gt;&quot;&lt;%=module_helper_loaded%&gt;&quot;)
   end
-    
-  
+
+
   def profile_update(to,f)
     send_as :profile
     recipients to
     profile &quot;profile&quot;
     profile_action &quot;profile_action&quot;
     mobile_profile &quot;mobile_profile&quot;
-    
+
   end
-  
+
    def profile_update_with_profile_main(to,f)
     send_as :profile
     recipients to
@@ -79,40 +79,40 @@ class TestPublisher &lt; Facebooker::Rails::Publisher
     mobile_profile &quot;mobile_profile&quot;
     profile_main &quot;profile_main&quot;
   end
-  
+
   def ref_update(user)
     send_as :ref
     fbml &quot;fbml&quot;
     handle &quot;handle&quot;
   end
-  
+
   def user_action_template
     one_line_story_template &quot;{*actor*} did stuff with {*friend*}&quot;
     short_story_template &quot;{*actor*} has a title {*friend*}&quot;, render(:inline=&gt;&quot;This is a test render&quot;)
     full_story_template &quot;{*actor*} did a lot&quot;,&quot;This is the full body&quot;,:img=&gt;{:some_params=&gt;true}
   end
-  
+
   def simple_user_action_template
-    one_line_story_template &quot;{*actor*} did stuff with {*friend*}&quot;    
+    one_line_story_template &quot;{*actor*} did stuff with {*friend*}&quot;
   end
-  
+
   def user_action_with_action_links_template
     one_line_story_template &quot;{*actor*} did stuff with {*friend*}&quot;
     short_story_template &quot;{*actor*} has a title {*friend*}&quot;, render(:inline=&gt;&quot;This is a test render&quot;)
     full_story_template &quot;{*actor*} did a lot&quot;,&quot;This is the full body&quot;,:img=&gt;{:some_params=&gt;true}
     action_links action_link(&quot;Source&quot;,&quot;HREF&quot;)
   end
-  
+
   def user_action(user)
     send_as :user_action
     from user
     data :friend=&gt;&quot;Mike&quot;
   end
-  
+
   def user_action_with_template_id(user)
     send_as :user_action
     from user
-    data :friend=&gt;&quot;Mike&quot;  
+    data :friend=&gt;&quot;Mike&quot;
     template_id 4
   end
   def user_action_with_story_size(user)
@@ -127,130 +127,135 @@ class TestPublisher &lt; Facebooker::Rails::Publisher
     send_as :user_action
     from user
   end
-  
+
   def no_send_as(to)
     recipients to
   end
-  
+
   def invalid_send_as(to)
     send_as :fake
     recipients to
   end
-  
+
 end
 
 class Facebooker::Rails::Publisher::FacebookTemplateTest &lt; Test::Unit::TestCase
   FacebookTemplate = Facebooker::Rails::Publisher::FacebookTemplate
-  
+  include Facebooker::Rails::TestHelpers
+
   def setup
     super
     @template = mock(&quot;facebook template&quot;)
     FacebookTemplate.stubs(:register).returns(@template)
     FacebookTemplate.clear_cache!
   end
-  
+
   def test_find_or_register_calls_find_cached
     FacebookTemplate.expects(:find_cached).with(TestPublisher,&quot;simple_user_action&quot;).returns(@template)
     assert_equal FacebookTemplate.for_class_and_method(TestPublisher,&quot;simple_user_action&quot;),@template
-  end  
-  
+  end
+
   def test_find_cached_should_use_cached_if_it_exists
     FacebookTemplate.cache(TestPublisher,&quot;simple_user_action&quot;,@template)
     assert_equal FacebookTemplate.find_cached(TestPublisher,&quot;simple_user_action&quot;), @template
-    
+
   end
-  
+
   def test_find_cached_should_call_find_in_db_if_not_in_cache
     FacebookTemplate.expects(:find_in_db).with(TestPublisher,&quot;simple_user_action&quot;).returns(@template)
     assert_equal FacebookTemplate.find_cached(TestPublisher,&quot;simple_user_action&quot;), @template
   end
-  
+
   def test_find_in_db_should_run_find
     FacebookTemplate.expects(:find_by_template_name).with(&quot;TestPublisher::simple_user_action&quot;).returns(@template)
     @template.stubs(:template_changed?).returns(false)
     assert_equal FacebookTemplate.find_in_db(TestPublisher,&quot;simple_user_action&quot;), @template
   end
-  
+
   def test_find_in_db_should_register_if_not_found
     FacebookTemplate.expects(:find_by_template_name).with(&quot;TestPublisher::simple_user_action&quot;).returns(nil)
     FacebookTemplate.expects(:register).with(TestPublisher,&quot;simple_user_action&quot;).returns(@template)
     FacebookTemplate.find_cached(TestPublisher,&quot;simple_user_action&quot;)
-    
+
   end
-  
+
   def test_find_in_db_should_check_for_change_if_found
     FacebookTemplate.stubs(:find_by_template_name).returns(@template)
     FacebookTemplate.stubs(:hashed_content).returns(&quot;MY CONTENT&quot;)
     @template.expects(:template_changed?).with(&quot;MY CONTENT&quot;).returns(false)
-    FacebookTemplate.find_in_db(TestPublisher,&quot;simple_user_action&quot;)  
+    FacebookTemplate.find_in_db(TestPublisher,&quot;simple_user_action&quot;)
   end
-  
+
   def test_find_in_db_should_destroy_old_record_if_changed
     FacebookTemplate.stubs(:find_by_template_name).returns(@template)
     FacebookTemplate.stubs(:hashed_content).returns(&quot;MY CONTENT&quot;)
     @template.stubs(:template_changed?).returns(true)
     @template.expects(:destroy)
-    FacebookTemplate.find_in_db(TestPublisher,&quot;simple_user_action&quot;)  
+    FacebookTemplate.find_in_db(TestPublisher,&quot;simple_user_action&quot;)
   end
-  
+
   def test_find_in_db_should_re_register_if_changed
     FacebookTemplate.stubs(:find_by_template_name).with(&quot;TestPublisher::simple_user_action&quot;).returns(@template)
     FacebookTemplate.stubs(:hashed_content).returns(&quot;MY CONTENT&quot;)
     @template.stubs(:template_changed?).returns(true)
     @template.stubs(:destroy)
     FacebookTemplate.expects(:register).with(TestPublisher,&quot;simple_user_action&quot;).returns(@template)
-    FacebookTemplate.find_in_db(TestPublisher,&quot;simple_user_action&quot;)    
+    FacebookTemplate.find_in_db(TestPublisher,&quot;simple_user_action&quot;)
   end
 end
 
 class Facebooker::Rails::Publisher::PublisherTest &lt; Test::Unit::TestCase
   FacebookTemplate = Facebooker::Rails::Publisher::FacebookTemplate
-  
+
   def setup
     super
+
+    ENV['FACEBOOK_API_KEY'] = '1234567'
+    ENV['FACEBOOK_SECRET_KEY'] = '7654321'
+
     @user = Facebooker::User.new
     @user.id=4
     @session = &quot;session&quot;
     @user.stubs(:session).returns(@session)
   end
-  
+
   def teardown
     super
   end
-  
+
   def test_create_action
     action=TestPublisher.create_action(@user)
     assert_equal Facebooker::Feed::Action,action.class
     assert_equal &quot;Action Title&quot;,action.title
   end
-  
+
   def test_deliver_action
     @user.expects(:publish_action)
     TestPublisher.deliver_action(@user)
   end
-  
+
   def test_create_story
     action=TestPublisher.create_story(@user)
     assert_equal Facebooker::Feed::Story,action.class
     assert_equal &quot;Story Title&quot;,action.title
   end
-  
+
   def test_deliver_story
     @user.expects(:publish_story)
-    TestPublisher.deliver_story(@user)    
+    TestPublisher.deliver_story(@user)
   end
-  
+
   def test_create_notification
     notification=TestPublisher.create_notification(12451752,@user)
     assert_equal Facebooker::Rails::Publisher::Notification,notification.class
     assert_equal &quot;Not&quot;,notification.fbml
   end
-  
+
   def test_deliver_notification
     @session.expects(:send_notification)
     TestPublisher.deliver_notification(&quot;12451752&quot;,@user)
   end
-  
+
   def test_create_email
     email=TestPublisher.create_email(&quot;12451752&quot;,@user)
     assert_equal Facebooker::Rails::Publisher::Email,email.class
@@ -258,21 +263,21 @@ class Facebooker::Rails::Publisher::PublisherTest &lt; Test::Unit::TestCase
     assert_equal &quot;text&quot;,email.text
     assert_equal &quot;text&quot;,email.fbml
   end
-  
+
   def test_deliver_email
     @session.expects(:send_email)
     TestPublisher.deliver_email(&quot;12451752&quot;,@user)
   end
-  
+
   def test_create_templatized_action
     ta=TestPublisher.create_templatized_action(@user)
     assert_equal Facebooker::Feed::TemplatizedAction,ta.class
     assert_equal &quot;Templatized Action Title&quot;,ta.title_template
-    
+
   end
-  
-  
-  
+
+
+
   def test_deliver_templatized_action
     @user.expects(:publish_action)
     TestPublisher.deliver_templatized_action(@user)
@@ -292,28 +297,28 @@ class Facebooker::Rails::Publisher::PublisherTest &lt; Test::Unit::TestCase
     assert_equal &quot;mobile_profile&quot;,p.mobile_profile
     assert_equal &quot;profile_main&quot;,p.profile_main
   end
-  
-  
+
+
   def test_deliver_profile
     Facebooker::User.stubs(:new).returns(@user)
     @user.expects(:set_profile_fbml).with('profile', 'mobile_profile', 'profile_action',nil)
-    TestPublisher.deliver_profile_update(@user,@user)    
+    TestPublisher.deliver_profile_update(@user,@user)
   end
-  
+
    def test_deliver_profile_with_main
     Facebooker::User.stubs(:new).returns(@user)
     @user.expects(:set_profile_fbml).with('profile', 'mobile_profile', 'profile_action','profile_main')
-    TestPublisher.deliver_profile_update_with_profile_main(@user,@user)    
+    TestPublisher.deliver_profile_update_with_profile_main(@user,@user)
   end
-  
-  
+
+
   def test_create_ref_update
     p=TestPublisher.create_ref_update(@user)
     assert_equal Facebooker::Rails::Publisher::Ref,p.class
     assert_equal &quot;fbml&quot;,p.fbml
     assert_equal &quot;handle&quot;,p.handle
   end
-  
+
   def test_deliver_ref_update
     Facebooker::Session.stubs(:create).returns(@session)
     @server_cache=&quot;server_cache&quot;
@@ -321,7 +326,7 @@ class Facebooker::Rails::Publisher::PublisherTest &lt; Test::Unit::TestCase
     @server_cache.expects(:set_ref_handle).with(&quot;handle&quot;,&quot;fbml&quot;)
     TestPublisher.deliver_ref_update(@user)
   end
-  
+
   def test_register_user_action
    Facebooker::Rails::Publisher::FacebookTemplate.expects(:register)
     TestPublisher.register_user_action
@@ -331,7 +336,7 @@ class Facebooker::Rails::Publisher::PublisherTest &lt; Test::Unit::TestCase
     Facebooker::Rails::Publisher::FacebookTemplate.expects(:register)
     TestPublisher.register_user_action_with_action_links
   end
-  
+
   def test_create_user_action
     @from_user = Facebooker::User.new
     @session = Facebooker::Session.new(&quot;&quot;,&quot;&quot;)
@@ -351,13 +356,13 @@ class Facebooker::Rails::Publisher::PublisherTest &lt; Test::Unit::TestCase
     ua = TestPublisher.create_user_action_with_template_id(@from_user)
     assert_equal 4,ua.template_id
   end
-  
+
   def test_publisher_user_action
     @from_user = Facebooker::User.new
     @session = Facebooker::Session.new(&quot;&quot;,&quot;&quot;)
     @from_user.stubs(:session).returns(@session)
     @session.expects(:publish_user_action).with(20309041537,{:friend=&gt;&quot;Mike&quot;},nil,nil,nil)
-    
+
     Facebooker::Rails::Publisher::FacebookTemplate.expects(:bundle_id_for_class_and_method).
                                                    with(TestPublisher, 'user_action').
                                                    returns(20309041537)
@@ -366,26 +371,26 @@ class Facebooker::Rails::Publisher::PublisherTest &lt; Test::Unit::TestCase
     # Facebooker::Rails::Publisher::FacebookTemplate.expects(:for).returns(pseudo_template)
     TestPublisher.deliver_user_action(@from_user)
   end
-  
+
   def test_publish_user_action_with_story_size
     @from_user = Facebooker::User.new
     @session = Facebooker::Session.new(&quot;&quot;,&quot;&quot;)
     @from_user.stubs(:session).returns(@session)
     @session.expects(:publish_user_action).with(20309041537,{:friend=&gt;&quot;Mike&quot;},nil,nil,2)
-    
+
     Facebooker::Rails::Publisher::FacebookTemplate.expects(:bundle_id_for_class_and_method).
                                                    with(TestPublisher, 'user_action_with_story_size').
                                                    returns(20309041537)
     TestPublisher.deliver_user_action_with_story_size(@from_user)
-    
+
   end
-  
+
   def test_publishing_user_data_no_action_gives_nil_hash
     @from_user = Facebooker::User.new
     @session = Facebooker::Session.new(&quot;&quot;,&quot;&quot;)
     @from_user.stubs(:session).returns(@session)
     @session.expects(:publish_user_action).with(20309041537,{},nil,nil,nil)
-    
+
     Facebooker::Rails::Publisher::FacebookTemplate.stubs(:bundle_id_for_class_and_method).returns(20309041537)
     TestPublisher.deliver_user_action_no_data(@from_user)
   end
@@ -394,14 +399,14 @@ class Facebooker::Rails::Publisher::PublisherTest &lt; Test::Unit::TestCase
       TestPublisher.deliver_no_send_as(@user)
     }
   end
-  
+
   def test_invalid_send_as_raises
     assert_raises(Facebooker::Rails::Publisher::UnknownBodyType) {
       TestPublisher.deliver_invalid_send_as(@user)
     }
   end
-  
-  
+
+
   def test_keeps_class_method_missing
     assert_raises(NoMethodError) {
       TestPublisher.fake
@@ -412,7 +417,7 @@ class Facebooker::Rails::Publisher::PublisherTest &lt; Test::Unit::TestCase
       TestPublisher.new.fake
     }
   end
-  
+
   def test_image_urls
     Facebooker.expects(:facebook_path_prefix).returns(&quot;/mike&quot;)
     string_image = TestPublisher.new.image('image.png', 'raw_string')
@@ -421,7 +426,7 @@ class Facebooker::Rails::Publisher::PublisherTest &lt; Test::Unit::TestCase
     route_image = TestPublisher.new.image('image.png', {:controller =&gt; :pokes, :action =&gt; :do, :id =&gt; 1})
     assert_equal('http://apps.facebook.com/mike/pokes/do/1',route_image.href)
   end
-  
+
   def test_image_to_json_puts_src_first
     string_image = TestPublisher.new.image('image.png', 'raw_string')
     assert_equal &quot;{\&quot;src\&quot;:\&quot;/images/image.png\&quot;, \&quot;href\&quot;:\&quot;raw_string\&quot;}&quot;,string_image.to_json
@@ -429,40 +434,44 @@ class Facebooker::Rails::Publisher::PublisherTest &lt; Test::Unit::TestCase
   def test_action_link
     assert_equal({:text=&gt;&quot;text&quot;, :href=&gt;&quot;href&quot;}, TestPublisher.new.action_link(&quot;text&quot;,&quot;href&quot;))
   end
-  
+
   def test_default_url_options
     Facebooker.expects(:facebook_path_prefix).returns(&quot;/mike&quot;)
     assert_equal({:host=&gt;&quot;apps.facebook.com/mike&quot;},TestPublisher.default_url_options)
   end
-  
+
   def test_recipients
     tp=TestPublisher.new
     tp.recipients &quot;a&quot;
     assert_equal(&quot;a&quot;,tp.recipients)
   end
-  
+
   def test_symbol_helper
     assert TestPublisher.new.symbol_helper_loaded
   end
   def test_module_helper
     assert TestPublisher.new.module_helper_loaded
   end
-  
+
   def test_with_render
     #normally Rails would do this for us
-    if ActionController::Base.respond_to?(:append_view_path)
-      ActionController::Base.append_view_path(&quot;./test/../../app/views&quot;)
+    silence_warnings do
+      if ActionController::Base.respond_to?(:append_view_path)
+        ActionController::Base.append_view_path(&quot;./test/../../app/views&quot;)
+      end
+      notification=TestPublisher.create_render_notification(12451752,@user)
+      assert_equal &quot;true&quot;,notification.fbml
     end
-    notification=TestPublisher.create_render_notification(12451752,@user)
-    assert_equal &quot;true&quot;,notification.fbml
   end
-  
+
   def test_notification_as_announcement
     #normally Rails would do this for us
-    if ActionController::Base.respond_to?(:append_view_path)
-      ActionController::Base.append_view_path(&quot;./test/../../app/views&quot;)
+    silence_warnings do
+      if ActionController::Base.respond_to?(:append_view_path)
+        ActionController::Base.append_view_path(&quot;./test/../../app/views&quot;)
+      end
+      notification=TestPublisher.create_render_notification(12451752,nil)
+      assert_equal &quot;true&quot;,notification.fbml
     end
-    notification=TestPublisher.create_render_notification(12451752,nil)
-    assert_equal &quot;true&quot;,notification.fbml
   end
 end</diff>
      <filename>test/facebooker/rails/publisher_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,17 +1,8 @@
 require File.expand_path(File.dirname(__FILE__) + '/../rails_test_helper')
 
-ActionController::Routing::Routes.draw do |map|
-  map.connect '', :controller=&gt;&quot;facebook&quot;,:conditions=&gt;{:canvas=&gt;true}
-  map.connect '', :controller=&gt;&quot;plain_old_rails&quot;
-  map.resources :comments, :controller=&gt;&quot;plain_old_rails&quot;
-  map.connect 'require_auth/:action', :controller =&gt; &quot;controller_which_requires_facebook_authentication&quot;
-  map.connect 'require_install/:action', :controller =&gt; &quot;controller_which_requires_application_installation&quot;
-  map.connect ':controller/:action/:id', :controller =&gt; &quot;plain_old_rails&quot;
-end  
-
 module FBConnectTestHelpers
   def setup_fb_connect_cookies(params=cookie_hash_for_auth)
-    params.each {|k,v| @request.cookies[ENV['FACEBOOK_API_KEY']+k] = CGI::Cookie.new(ENV['FACEBOOK_API_KEY']+k,v)} 
+    params.each {|k,v| @request.cookies[ENV['FACEBOOK_API_KEY']+k] = CGI::Cookie.new(ENV['FACEBOOK_API_KEY']+k,v)}
   end
 
   def expired_cookie_hash_for_auth
@@ -193,7 +184,7 @@ class RailsIntegrationTestForNonFacebookControllers &lt; Test::Unit::TestCase
 
   def test_url_for_links_to_callback_if_canvas_is_false_and_in_canvas
     get :link_test
-    assert_match /test.host/,@response.body
+    assert_match(/test.host/, @response.body)
   end
   
   def test_named_route_doesnt_include_canvas_path_when_not_in_canvas
@@ -444,33 +435,33 @@ class RailsIntegrationTest &lt; Test::Unit::TestCase
     assert_match &quot;http-equiv&quot;, @response.body
     assert_match &quot;http://www.facebook.com/login.php?api_key=1234567&amp;v=1.0&quot;.to_json, @response.body
     assert_match &quot;http://www.facebook.com/login.php?api_key=1234567&amp;amp;v=1.0&quot;, @response.body
-  end  
-  
+  end
+
   def test_url_for_links_to_canvas_if_canvas_is_true_and_not_in_canvas
     get :link_test, facebook_params(:fb_sig_in_canvas=&gt;0,:canvas=&gt;true)
-    assert_match /apps.facebook.com/,@response.body
+    assert_match(/apps.facebook.com/, @response.body)
   end
-  
+
   def test_includes_relative_url_root_when_linked_to_canvas
     get :link_test,facebook_params(:fb_sig_in_canvas=&gt;0,:canvas=&gt;true)
-    assert_match /root/,@response.body
+    assert_match(/root/,@response.body)
   end
 
   def test_url_for_links_to_callback_if_canvas_is_false_and_in_canvas
     get :link_test,facebook_params(:fb_sig_in_canvas=&gt;0,:canvas=&gt;false)
-    assert_match /test.host/,@response.body
+    assert_match(/test.host/,@response.body)
   end
 
   def test_url_for_doesnt_include_url_root_when_not_linked_to_canvas
     get :link_test,facebook_params(:fb_sig_in_canvas=&gt;0,:canvas=&gt;false)
     assert !@response.body.match(/root/)
   end
-  
+
   def test_url_for_links_to_canvas_if_canvas_is_not_set
     get :link_test,facebook_params
-    assert_match /apps.facebook.com/,@response.body
+    assert_match(/apps.facebook.com/,@response.body)
   end
-  
+
   def test_image_tag
     get :image_test, facebook_params
     assert_equal &quot;&lt;img alt=\&quot;Image\&quot; src=\&quot;http://root.example.com/images/image.png\&quot; /&gt;&quot;,@response.body
@@ -660,35 +651,35 @@ class RailsHelperTest &lt; Test::Unit::TestCase
     assert_equal &quot;&lt;fb:add-section-button section=\&quot;info\&quot; /&gt;&quot;,@h.fb_add_info_section
   end
 
-  def test_fb_name_with_invalid_key
+  def test_fb_name_with_invalid_key_sizee
     assert_raises(ArgumentError) {@h.fb_name(1234, :sizee =&gt; false)}
   end
 
   def test_fb_name
     assert_equal &quot;&lt;fb:name uid=\&quot;1234\&quot;&gt;&lt;/fb:name&gt;&quot;,@h.fb_name(&quot;1234&quot;)
   end
-    
+
   def test_fb_name_with_transformed_key
     assert_equal &quot;&lt;fb:name uid=\&quot;1234\&quot; useyou=\&quot;true\&quot;&gt;&lt;/fb:name&gt;&quot;, @h.fb_name(1234, :use_you =&gt; true)
   end
-  
+
   def test_fb_name_with_user_responding_to_facebook_id
     user = flexmock(&quot;user&quot;, :facebook_id =&gt; &quot;5678&quot;)
     assert_equal &quot;&lt;fb:name uid=\&quot;5678\&quot;&gt;&lt;/fb:name&gt;&quot;, @h.fb_name(user)
   end
-  
-  def test_fb_name_with_invalid_key
+
+  def test_fb_name_with_invalid_key_linkd
     assert_raises(ArgumentError) {@h.fb_name(1234, :linkd =&gt; false)}
   end
-  
+
   def test_fb_tabs
     assert_equal &quot;&lt;fb:tabs&gt;&lt;/fb:tabs&gt;&quot;, @h.fb_tabs{}
   end
-  
+
   def test_fb_tab_item
     assert_equal &quot;&lt;fb:tab-item href=\&quot;http://www.google.com\&quot; title=\&quot;Google\&quot; /&gt;&quot;, @h.fb_tab_item(&quot;Google&quot;, &quot;http://www.google.com&quot;)
   end
-  
+
   def test_fb_tab_item_raises_exception_for_invalid_option
     assert_raises(ArgumentError) {@h.fb_tab_item(&quot;Google&quot;, &quot;http://www.google.com&quot;, :alignn =&gt; :right)}
   end
@@ -708,10 +699,6 @@ class RailsHelperTest &lt; Test::Unit::TestCase
     assert_equal &quot;&lt;fb:multi-friend-selector actiontext=\&quot;This is a message\&quot; exclude_ids=\&quot;1,2\&quot; max=\&quot;20\&quot; showborder=\&quot;false\&quot; /&gt;&quot;, @h.fb_multi_friend_selector(&quot;This is a message&quot;,:exclude_ids=&gt;&quot;1,2&quot;)
   end
 
-  def test_fb_comments
-    assert_equal &quot;&lt;fb:comments candelete=\&quot;false\&quot; canpost=\&quot;true\&quot; numposts=\&quot;7\&quot; showform=\&quot;true\&quot; xid=\&quot;a:1\&quot; /&gt;&quot;, @h.fb_comments(&quot;a:1&quot;,true,false,7,:showform=&gt;true)
-  end
-  
   def test_fb_title
     assert_equal &quot;&lt;fb:title&gt;This is the canvas page window title&lt;/fb:title&gt;&quot;, @h.fb_title(&quot;This is the canvas page window title&quot;)
   end
@@ -919,9 +906,15 @@ class RailsHelperTest &lt; Test::Unit::TestCase
   def test_fb_create_button
     assert_equal &quot;&lt;fb:create-button href=\&quot;/growingpets/invite\&quot;&gt;Invite Friends&lt;/fb:create-button&gt;&quot;, @h.fb_create_button('Invite Friends', '/growingpets/invite')
   end
-  def test_fb_comments
-    assert_equal &quot;&lt;fb:comments candelete=\&quot;false\&quot; canpost=\&quot;true\&quot; numposts=\&quot;4\&quot; optional=\&quot;false\&quot; xid=\&quot;xxx\&quot;&gt;&lt;/fb:comments&gt;&quot;, @h.fb_comments(&quot;xxx&quot;,true,false,4,:optional=&gt;false) 
+
+  def test_fb_comments_a_1
+    assert_equal &quot;&lt;fb:comments candelete=\&quot;false\&quot; canpost=\&quot;true\&quot; numposts=\&quot;7\&quot; showform=\&quot;true\&quot; xid=\&quot;a:1\&quot;&gt;&lt;/fb:comments&gt;&quot;, @h.fb_comments(&quot;a:1&quot;,true,false,7,:showform=&gt;true)
   end
+
+  def test_fb_comments_xxx
+    assert_equal &quot;&lt;fb:comments candelete=\&quot;false\&quot; canpost=\&quot;true\&quot; numposts=\&quot;4\&quot; optional=\&quot;false\&quot; xid=\&quot;xxx\&quot;&gt;&lt;/fb:comments&gt;&quot;, @h.fb_comments(&quot;xxx&quot;,true,false,4,:optional=&gt;false)
+  end
+
   def test_fb_comments_with_title
     assert_equal &quot;&lt;fb:comments candelete=\&quot;false\&quot; canpost=\&quot;true\&quot; numposts=\&quot;4\&quot; optional=\&quot;false\&quot; xid=\&quot;xxx\&quot;&gt;&lt;fb:title&gt;TITLE&lt;/fb:title&gt;&lt;/fb:comments&gt;&quot;, @h.fb_comments(&quot;xxx&quot;,true,false,4,:optional=&gt;false, :title =&gt; &quot;TITLE&quot;) 
   end
@@ -1003,13 +996,15 @@ class RailsHelperTest &lt; Test::Unit::TestCase
     action = Facebooker::Rails::Publisher::UserAction.new
     assert_equal @h.fb_user_action(action,&quot;message&quot;,&quot;prompt&quot;),&quot;FB.Connect.showFeedDialog(null, null, null, null, null, FB.RequireConnect.promptConnect, null, \&quot;prompt\&quot;, \&quot;message\&quot;);&quot;
   end
-  
-  
+
+
   def test_fb_connect_javascript_tag
-    assert_equal &quot;&lt;script src=\&quot;http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php\&quot; type=\&quot;text/javascript\&quot;&gt;&lt;/script&gt;&quot;,
-      @h.fb_connect_javascript_tag
+    silence_warnings do
+      assert_equal &quot;&lt;script src=\&quot;http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php\&quot; type=\&quot;text/javascript\&quot;&gt;&lt;/script&gt;&quot;,
+        @h.fb_connect_javascript_tag
+    end
   end
-  
+
   def test_fb_container
     @h.expects(:capture).returns(&quot;Inner Stuff&quot;)
     @h.fb_container(:condition=&gt;&quot;somejs&quot;) do
@@ -1157,19 +1152,23 @@ class RailsPrettyErrorsTest &lt; Test::Unit::TestCase
     post :pass, facebook_params
     assert_response 200
   end
-  
+
   def test_pretty_errors_disabled_error
     Facebooker.apply_configuration('api_key'=&gt;&quot;1234&quot;, 'secret_key'=&gt;&quot;34278&quot;,'canvas_page_name'=&gt;'mike','pretty_errors'=&gt;false)
-    post :fail, facebook_params
+    silence_warnings do
+      post :fail, facebook_params
+    end
     assert_response :error
   end
-  
+
   def test_pretty_errors_enabled_success
     post :pass, facebook_params
     assert_response 200
   end
   def test_pretty_errors_enabled_error
-    post :fail, facebook_params
+    silence_warnings do
+      post :fail, facebook_params
+    end
     assert_response 200
   end
 end</diff>
      <filename>test/facebooker/rails_integration_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,19 +14,19 @@ class Facebooker::SessionTest &lt; Test::Unit::TestCase
 
   def teardown
     Facebooker::Session.configuration_file_path = nil
-    super    
+    super
   end
-  
+
   def test_install_url_escapes_optional_next_parameter
     session = Facebooker::CanvasSession.create(ENV['FACEBOOK_API_KEY'], ENV['FACEBOOK_SECRET_KEY'])
     assert_equal(&quot;http://www.facebook.com/install.php?api_key=1234567&amp;v=1.0&amp;next=next_url%3Fa%3D1%26b%3D2&quot;, session.install_url(:next =&gt; &quot;next_url?a=1&amp;b=2&quot;))
   end
-  
+
   def test_can_get_api_and_secret_key_from_environment
     assert_equal('1234567', Facebooker::Session.api_key)
-    assert_equal('7654321', Facebooker::Session.secret_key)    
+    assert_equal('7654321', Facebooker::Session.secret_key)
   end
-  
+
   def test_if_keys_are_not_available_via_environment_then_they_are_gotten_from_a_file
     ENV['FACEBOOK_API_KEY'], ENV['FACEBOOK_SECRET_KEY'] = nil
     flexmock(File).should_receive(:read).with(File.expand_path(&quot;~/.facebookerrc&quot;)).once.and_return('{:api =&gt; &quot;foo&quot;}')</diff>
      <filename>test/facebooker/session_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../test_helper.rb'
+require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
 require 'rack/facebook'
 require 'rack/lint'
 require 'rack/mock'</diff>
      <filename>test/rack/facebook_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,11 @@
 require File.expand_path(File.dirname(__FILE__) + '/test_helper')
 
+tmp = $-w
+$-w = nil
 require 'action_controller'
 require 'action_controller/test_process'
 require 'active_record'
+$-w = tmp
 gem 'rails'
 require 'initializer'
 require File.dirname(__FILE__)+'/../init'
@@ -11,3 +14,14 @@ require 'facebooker/rails/helpers/fb_connect'
 require 'facebooker/rails/helpers'
 require 'facebooker/rails/publisher'
 require 'facebooker/rails/facebook_form_builder'
+
+ActionController::Routing::Routes.draw do |map|
+  map.connect '', :controller=&gt;&quot;facebook&quot;,:conditions=&gt;{:canvas=&gt;true}
+  map.connect '', :controller=&gt;&quot;plain_old_rails&quot;
+  map.resources :comments, :controller=&gt;&quot;plain_old_rails&quot;
+  map.connect 'require_auth/:action', :controller =&gt; &quot;controller_which_requires_facebook_authentication&quot;
+  map.connect 'require_install/:action', :controller =&gt; &quot;controller_which_requires_application_installation&quot;
+  silence_warnings do
+    map.connect ':controller/:action/:id', :controller =&gt; &quot;plain_old_rails&quot;
+  end
+end</diff>
      <filename>test/rails_test_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
 require 'test/unit'
 require 'rubygems'
+
 begin
   require 'multi_rails_init'
 rescue LoadError
@@ -24,16 +25,16 @@ require 'facebooker/rails/test_helpers'
 
 class Test::Unit::TestCase
   include Facebooker::Rails::TestHelpers
-    
+
   private
-  
+
   def expect_http_posts_with_responses(*responses_xml)
     mock_http = establish_session
     responses_xml.each do |xml_string|
       mock_http.should_receive(:post_form).and_return(xml_string).once.ordered(:posts)
-    end   
+    end
   end
-  
+
   def establish_session(session = @session)
     mock = flexmock(Net::HTTP).should_receive(:post_form).and_return(example_auth_token_xml).once.ordered(:posts)
     mock.should_receive(:post_form).and_return(example_get_session_xml).once.ordered(:posts)</diff>
      <filename>test/test_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>40334bd74a48b95ecd67f389d41ef5119f517dd5</id>
    </parent>
  </parents>
  <author>
    <name>Aaron Patterson</name>
    <email>aaron.patterson@gmail.com</email>
  </author>
  <url>http://github.com/mmangino/facebooker/commit/6254e8c5eb848aa9b40b4bd171fc3e87f747b3de</url>
  <id>6254e8c5eb848aa9b40b4bd171fc3e87f747b3de</id>
  <committed-date>2009-04-28T16:00:26-07:00</committed-date>
  <authored-date>2009-04-28T16:00:26-07:00</authored-date>
  <message>Fixing lots of warnings, making test file run on their own, adding a
.autotest file.</message>
  <tree>62b2b31bf5b8caed7211c985fbf9a6503d833c50</tree>
  <committer>
    <name>Aaron Patterson</name>
    <email>aaron.patterson@gmail.com</email>
  </committer>
</commit>
