Testing Rails controllers communicating with external web services

As I was writing the code to accept payments through Paypal for MyOwnDB, I kept wondering how I could write functional tests to validate it. All those methods initiate or react to communications with Paypal, and although there's a sandbox available, you cannot predict the id assigned to the transactions and that must be returned to Paypal (see below for how this validation works)., This clearly limited the scope of the tests I could write.

Google sitemap for Ruby on Rails website

I was building a Google site map for using their generator (in python). Using the generator is very easy: just edit the config file according to the comments included the example. You can configure the generator to analyze access logs of your webserver to extract URLs to put in the sitemap.

Rails and Paypal's Payment Data Transfer

When you use Paypal to get payments, you can configure a return URL to which the payer will be redirected. When you activate Payment Data Transfer, you get some information about the payment that redirected to your site. The paypal gem (more info at leetsoft, although the doc you'll find there is out of date) doesn't work with Payment Data Transfer, but only with Instant Payment Notification (notification made separately by Paypal making a post request to your server).

Microsoft sponsors Firefox ads streaming

Yes, you read it well. As MyOwnDB is developed mainly with advanced browsers in mind, it's good to see Firefox promotion being alive and kicking. And it gets funny when you see that when you watch submissions to the Firefox Flicks on, you get them through a streaming that is sponsored by Microsoft, and that is in the flash format.

Eating my own dogfood with public forms

There's a feature in MyOwnDB that was there from the start, but maybe not publicised enough: you can publish a entry form for each of your tables. And in this form, you get all data validation! No bogus email will make it in your database! (well, email validation is regexp based, so it's not 100% safe, but it'll limit the errors). And I'm using this functionality in the contact page at

Export is here!

One important thing for us is to not take the data of MyOwnDB users as hostage. All data stored in MyOwnDB belongs to their respective users. As such, we found it as much a problem as some users that there was no export function. Well, this problem is no more. Although we plan to go much further, we currently provide the export of the data of a table to a csv file. You can export all data of a table or apply a filter to get only the data you want. We also added the possibility to export search results to csv files.

There's nothing like going live

You can prepare everything as good as you want you'll always discover something when your application goes live and gets used by other people that beta tester. That's why I'm happy of the interest and the number of people signing up for a free account, and most of all, of the limited number of problems encountered. True, we've made 3 updates to the applications in the last 24 hours, but those fixed all issues encountered by users. The most annoying problem is that we can't accept details named "id", as it clashes with our internal structure.

Lots of visits

I sent a link to MyOwnDB to Emily Chang, from Ehub, and she actually posted it on Ehub. Seems her site is quite popular as we got hundreds of visits from there!

Link tables in MyOwnDB: a screencast.

I have published a screencast about linking entries in different tables in MyOwnDB. It first shows how the administrator should define it, and then demonstrates its use when managing data. You can define one-to-one and one-to-many relations, and the interfaces adapts itself according to circumstances (eg if there's no entry available for linking, the button to do it is hidden).

Ruby on Rails and multi-lingual sites

There's no internationalisation integrated in Ruby on Rails, but it is very easy to develop websites in multipple languages with it. I'll post here how I did translate the error messages generated by ActiveRecord validation rules At first, warning: I'm using an as yet unreleased translation plugin. The reason it is not yet available is that I haven't had time to package it right. I have a controller used to manage the translations, and I haven't had the time to really look for a solution to package it in the plugin.
Syndicate content