RFacebook Gets Unit Tests

Unit Tests Come to RFacebook

Finally, RFacebook on Rails has a unit testing suite. You can now run Rails testing like any other well-behaved Rails plugin. My apologies - this was a long time coming.

RFacebook Looking for Developers

The RFacebook project has been maintained mostly by myself, in addition to the very helpful patches of a few others (Evan Weaver and Scott Nedderman, to name just a few). In the coming months I will be quite busy, and I am looking for other developers that can help maintain the project.

To help ease new developers into the library, I’ve done a few things starting with version 0.9.2 of the gem:

  • Cleaned up the core - the API library is now cleaned up of cruft and is much easier to understand
  • Better documentation - the core API library is extensively documented, and the plugin extensions are getting better documentation as well.
  • Unit testing is well-separated - it is fairly simple to see where to place unit tests for any one component of RFacebook. Unit tests are organized into separate tests for Rails controller, model, sessions, plugin initialization, and core API calls.

Hopefully there are some great Rails developers that would like to contribute to what I think has become a pretty solid library, thanks to the already sizeable contributions of its users. With continuous vetting by tons of small developers, and a few large ones (like Causes), RFacebook should continue to provide a great, simple way to get into the Facebook Platform.

17 Responses to “RFacebook Gets Unit Tests”

  1. ror blog » Blog Archive » [Rails] Re: Facebook plugin with test cases? Says:

    […] http://www.livelearncode.com/archives/26 […]

  2. Umang Says:

    How do you push FBML to the profile box?

  3. Matt Says:

    The documentation for the API call “facebook.profile.setFBML” is here:

    http://developers.facebook.com/documentation.php?v=1.0&method=profile.setFBML

    You can do this in RFacebook as:

    fbsession.profile_setFBML(:markup => “your markup here”)

    Hope that helps.

  4. Ryan Says:

    Matt,

    I am relatively new to rails and ruby development, but I am using your library for a project and would love to help with the code base. Let me know how I can help out.

    Ryan

  5. Jim Jones Says:

    Excellent work on RFacebook. I continue to be impressed by its development progress. Thanks for all of your hard work!

    Jim

  6. Big Says:

    We’re extensively using RFacebook for several facebook apps, and will see if there are any areas that we might be able to help you out on. Great work and many thanks!

  7. Big Says:

    in a late night push right now for message attachments using RFacebook, the little icons you click on at the bottom of messages…..

  8. Mason Says:

    Hiya.

    First, thanks for such an awesome plugin. I was doing Facebook work with CodeIgniter before… not so much fun.

    One lil’ bit: When you upgraded to 0.9.7, you changed :mock_ajax to :full_callback. While I appreciate this behavior (as I was using it for uploading a file to my server, since FB doesn’t proxy FILE info), when you deprecate something, you typically don’t remove the behavior in the same release. When I went to deploy this morning, :mock_ajax was no longer working, and I freaked out for about ten seconds before I saw your deprecation warning in my logs. Working beautifully now, however.

    On the feature-request end, it would be nice to be able to authenticated a user who both isn’t in an iframe AND isn’t in the canvas. Again, I had to upload a file, and was hoping to maintain facebook sessions, as all the necessary information is posted back, but your first check is to see if they’re in an iframe first… and if not, ignore auth information. If there was a nice way of overriding this… I’d hug you.

    Anyhow… thanks again. S’been a joy.

  9. Matt Says:

    Hey Mason,

    Yea, sorry abou tht mock_ajax deprecation + behavior change - I had forgotten that I hadn’t actually released a version with just the notice.

    If you could submit your feature request on Rubyforge, that would be great. Things have been very busy these days and it makes it a lot easier to go to one place than to dig through blog comments + jypsie forums + rubyforge.

    Glad to hear things are working out so well!

  10. Chris Vincent Says:

    Thanks so much for RFacebook and for keeping it up to date! Here are a couple heads-up:

    First off, the Jypsie site is fux0red… for the last few days, it seems I’ve been inadvertently crashing the site; I would attempt to post a forum topic only to be served with a 500 error. But it doesn’t stop there, because after this first 500 error, the entire site of Jypsie.com just serves 500s! Happened yesterday and happened today. In fact, the site is still down from when I tried to post a topic about half an hour ago. Also, the forum lacks a search feature. May I suggest linking up to a more reliable and usable forum?

    Second, yesterday I installed Rails 2.0 RC1 and started a new Facebook app with RFacebook. Congratulations, just about everything seems to be in working order! The only thing I’ve found that doesn’t work anymore is the URL code; so far, attempting to use a named route gives me an absolute URL to the app’s hosted server rather than its respective canvas URL. Such a break isn’t unexpected, since Rails 2.0 has changed the way it handles named routes, but I suspect it should be an easy fix. I’ll probably try and work it out myself rather than wait for an update, and I’ll be sure to send you the code if I’m successful in the endeavor.

    Thanks again, I’m sure this project keeps you plenty busy, just know we developers are very grateful for your work!

  11. Matt Says:

    @Chris

    Glad to hear that RFacebook is mostly working in Rails 2.0. Things have been pretty busy for me so I haven’t had a lot of time to stay on top of that stuff, so any fixes you can make to the URL code is much appreciated :)

    I’ve been hearing more reports of problems with the Jypsie forums. I’m planning on revamping my personal site end of December, so at that time I’ll look into forum alternatives (or perhaps contact JDG to see whats up with Jypsie these days).

  12. Garbo Says:

    Matt, I would like to second Mason’s comment:

    “On the feature-request end, it would be nice to be able to authenticated a user who both isn’t in an iframe AND isn’t in the canvas. Again, I had to upload a file, and was hoping to maintain facebook sessions, as all the necessary information is posted back, but your first check is to see if they’re in an iframe first… and if not, ignore auth information. If there was a nice way of overriding this… I’d hug you.”

    I have also spent the past few weeks toying around with a facebook application. The major problem I have run into is when I try to upload a photo to facebook. Primarily I am directing all requests/form submissions to “apps.facebook.com/myapp/foo.” With this approach, there are no issues with the session. However, when attempting to upload an image, I must submit the “multipart/form-data” form directly back to my server and the session is lost! This is a royal pain in the ass and I am wondering if you have a workaround!

    Basically, I am trying to take a user image posted by a multipart form and upload it directly to facebook in my controller. Maybe I’m going about this all wrong, but one more headbutt and this monitor will be fresh out of pixels. Any help would be much appreciated.

    Cheers,
    Brian

  13. Matt Says:

    @Garbo

    Yea, these are definitely things on my list to get done…things have been super busy for me lately. I plan on getting some serious feature addition and bugfixes in the next few weeks.

  14. Jeff Lim Says:

    Matt, I second Chris Vincent’s (#comment-1496) comments on jypsie.com. I too attempted to post something, and heck, got a 500! And just as Chris observed, it’s been 500 (for the ENTIRE site) ever since…

    On the topic of bugfixes - care to comment on http://rubyforge.org/tracker/index.php?func=detail&aid=15869&group_id=3607&atid=13796 ?

    And thanks for your great work! It’s been nice to have a rails plugin for the stuff as well…

  15. Dale Says:

    Facebook seems to have made a lot of changes to their API over the past several months. In particular, it looks like the planned 17JAN08 changes to the profile_setFBML may break rfacebook .97. Is that true? Any chance you or someone else is going to have time to update rfacebook?

  16. Matt Says:

    Thanks for the update. I will be spending this weekend bugfixing and updating, so look for changes soon.

  17. Dale Says:

    RE my earlier post on the profile_setFBML changes, if all you’re using is standard html markup aimed at the profile_box (e.g., no mobile or other fancy stuff), then it appears .97 will work just fine so long as you replace :markup with :profile in your application code.

Leave a Reply