Marko Anastasov wrote this on October 5, 2009

Standup 2009/10/05

  • Polymorphic associations and Factory Girl: in your tests you need to create your objects separately and connect them as you would in the controller — for example:
  event = Factory(:event)
  rev = Factory.build(:revision, :user_id => event.user.id)
  event.revisions << rev
  assert event.save
  assert rev.save
  • A new version of rails.vim is out. When you install it, you get lots of handy shortcuts. For example, if you’re editing a file containing a test, typing :Rake will run it. :Rcontroller events will open EventsController, gf< over has_many :nap*kins opens Napkin model file and so on. In practice, with Vim’s autocompletion you actually need to type just two characters.

  • For apps running on Rails 2.3.4 make sure you upgrade your version of Passenger (currently 2.2.5), or you’ll get strange exceptions mentioning rewind and Unix sockets in their backtrace.

comments powered by Disqus

About Marko Anastasov

Rendered Text co-founder. Started with code, currently more focused on people and words. Foosball striker and entry-level cyclist.

Suggested Reads

Rails Testing Handbook

A new ebook on building test-driven Rails apps with RSpec and Cucumber.

At Rendered Text, we have a long history with Ruby on Rails. Checking the blog archive reminds me that we published first posts about working with Rails way back in 2009.

———

Rendered Text is a software company. For questions regarding Semaphore, please visit semaphoreci.com. Otherwise, feel free to get in touch any time by sending us an email.