Testing CSV Download With Cucumber

Thanks to Upstream for their blog post on testing pdfs with cucumber.

Testing CSV download is exactly the same apart from that we do not need to turn the PDF to text, simply because…it isn’t a PDF…

(From RedWritesHere)

On the way to Rails 3 - a link list

Rails 3 is coming! The first beta release of the new version is right around the corner and it should be released today or tomorrow… the release notes are already in the master branch.
For me this feels like the release of Rails 1.0 and I’m so excited about all the new changes and the great new features.
Rails 3 is a lot about changing your mindset to make use of the all new features and concepts.

I’ve collected some reading material for you about Rails 3 and the upcoming changes. Since the final Rails 3 is not yet released excpect some of the stuff that’s mentioned to be changed or already have changed in the beta. But this is a good start to catch up with all the Rails awesomeness:

Must-reads

Actually all of these links are “must-reads” but for those of you with little time. Read at least these:

Router

ActiveRecord / ActiveModel

ActionMailer

Views / JavaScript

Controller

Rack

Gem, Plugins, Dependencies

Generators

I18n

Other great reading

General Rails

I’ll update this list with upcoming Rails 3 resources.

update:

1. Added link to I18n changes (thanks @ Carlos)

Railscamp 09 UK - Margate

Letzte Woche haben wir das Railscamp UK 2009 besuchen können. Zusammen mit Sebastian haben wir uns mit dem Auto nach England auf den Weg gemacht. Nach zahlreichen Stunden (u.a. weil wir wegen eines Streiks der französischen Fähre See France 3 Stunden auf den Eurostar warten mussen) sind wir dann Freitag Abend mit einem Kasten Mate und einem Kasten Mühlen Kölsch in Margate angekommen. Zwei weitere spannende Tage haben wir dort verbracht. Neben Vorträgen wie CouchDB von Alexander Lang war auch wie Hacking, Gaming (We love urban terrror :) und Networking angesagt. Zusammen mit Rany haben wir unseren “google of counters” gebastelt (mehr dazu in einem weiteren Blogpost). Als Equipment diente uns dieses Jahr Bananajour - der Nachfolger von Gitjour bietet eine nette Weboberfläche um verfügbare Repositories zu sharen und clonen.

Ein paar Fotos vom Dreamland Margate und dem Railscamp gibt es in der Flickr-Gruppe RailscampUK aber auch im einzelnen hier, hier,hier, hier, und hier. Es war auf jeden Fall wieder eine sehr coole Zeit mit Mr. Jabba, Pat und Co. wir freuen uns auf das Railscamp nächstes Jahr. Nicht zu vergessen aber ist das Railscamp Münster am 28./29. November bei Zweitag! Alle weiteren Informationen findet ihr auf der Railscamp Seite.

Marget

Static content in your Rails application

Our heros over at thoughtbot.com blogged about static pages and their newly released Rails engine high_voltage. High Voltage helps you dealing with simple, stupid static content pages that nobody wants but everyone needs. ;) (With static pages I’m thinking of imprint, about us, etc.)

In our projects we had a similar solution but to edit the pages more easily and without the need to deploy the whole application we’re saving the content in the database.

Because the database part was missing in high_voltage but I’ve really liked the idea to extract that feature into a rails engine I’ve created a fork last night.

My fork checks if there is a valid template file in views/pages/ - if not it checks the Database and renders the views/pages/show template.

How to use it?

Installation

script/plugin install git://github.com/bumi/high_voltage.git

Create pages
this is up to you. ;)
You can add static files to your app/views/pages/ directory or create a database entry:

HighVoltage::Page.create(:title => "Hello world", :body => "High Voltage! High Voltage!")

That’s it!

For more information check the original thoughtbot post” - You should follow their blog anyway! - And have a look at the readme.

Hope you like my addons.
What are your solutions for static pages?

Continious integration mit Hudson und Integrity

Continious Integration ist ein wichtiger Bestandteil von Software, vor allem wenn mehrere Beteiligte am Projekt Teilnehmen. Nach jedem Push wird dann der aktuelle Code vom CI-System ausgecheckt und die gewünschten rake-Tasks ausgeführt. Neben dem schon bekannten CrusieControll.rb gibt es noch zwei andere interesannte Cnotinious Integration Tools die ich kurz vorstellen möchte: Integrity und Hudson.

Integrity

Integrity ist sehr einfach gestrickt. Nach der relativ simplen installation kann man verschiedene Projekte hinzufügen. Der einzige “overhead” der noch ensteht, ist das zusammenstellen eines rake-tasks den Integrity nach jedem pull ausführt. Dieser einfacher rake-Task kann als Einstieg dienen:

Nach jedem Build können die Entwickler auch über die zu verfügung stehenden Notifier (Email, Campfire, IRC, …) über den Stand informiert werden. Weiterhin gibt es auch ein Growl-Plugin und Dashboard-Widget. Der Build der Applikation wird über Github via einem POST-Webhook zu Integrity angetriggert.

Der einzige Nachteil ist, dass bei lang-andauernden Builds der entsprechende Webserver einen Timeout erreicht. Der kann natürlich hochgesetzt werden.

Integrity

Hudson

Hudson ist eine weitere Alternative. Es ist ein Java-Basiertes CI-System und wird out-of-the-box mit einem Webserver ausgeliefert. Entsprechende Debian-Packages gibt es hier. Hudson bietet gegenüber Integrity mehr Konfigurationsmöglichkeiten, daher dauert es ein bisschen länger bis man sein neues CI-System am laufen hat. Meet-Hudson bietet eine gute Übersicht über Hudson.

Der oben schon vorgestellte Rake-Task kann ebenfalls für Hudson verwendet werden. Allerdings müssen Plugins für eine Rake- und Githubunterstützung installiert werden (Git-Plugin und Rake-Plugin).

Bei Hudson ist der initiale Konfigurationsaufwand zwar geringer als bei Integrity, dafür müssen viele Plugins installiert und konfiguriert werden um seine “perfekte” CI-Umgebung ans laufen zu bekommen. Unschön an Hudson ist die fehlende unterstützung des triggern eines Builds über einen POST-Webhook. Stattdessen kann dies nur über ein GET getriggert, was aber seitens Github nicht unterstützt wird. Eine Alternative ist das periodische abprüfen von Änderungen in der Repository.

Hudson

Next Page →