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.
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.