rspec controller syntax
Posted by jacqui maher on November 29, 2007 at 05:26 PM
The rspec docs are great, but the example code for writing Rails controller specs is a little inconsistent.
For future reference, the ‘best way’ to specify your controller is like so:
describe Manage::ListingsController, "manage listings - for the boss" do
the old way, which you shouldn’t use, was like this:
describe "manage listings - for the boss" do
controller_name "Manage::Listings"
I ran into a problem specifying my namespaced controller the old way; controller_name calls camelize on the string you pass it after splitting it on the “::” - since we have several ListingsController classes in various namespaces, my spec was sending requests to the wrong ListingsController spec, causing all kinds of failures and sadness.
Thx to the caboose geniuses for helping me out on this one, notably court3nay
*hiccup*
Posted by jacqui maher on November 25, 2007 at 09:26 PM
I’m switching around a bunch of things on the backend here at brighter.net. Silly me thought to start this process in between returning from traveling in Europe and the Thanksgiving holiday. I think I am almost done, though, so hopefully my site will be seeing some decent uptime (and new features!) in the weeks to come. Thanks for hangin’ in there with me :)
on religion, and the pros and cons of regulating reincarnation
Posted by jacqui maher on November 25, 2007 at 09:00 PM
Slavoj Žižek is one of the great thinkers of our time. I’ve read a few of his books, most notably “Welcome to the Desert of the Real” but hadn’t read much about him recently.
I found a few of his books last week after opening yet another cardboard box; I swear that my apartment creates more boxes as time goes by, for surely I can’t possibly be opening these things, finding more STUFF, months after moving in… can I?
My packing and unpacking skills and propensity for being a pack rat, especially when it comes to books, not-withstanding, I read an article this morning by Žižek that I thought I would post here, in the hopes of exposing more people I know to him:
How China got religion, published in the International Herald Tribune. Yep, the first paragraph recounting the Chinese government’s absurd laws governing reincarnation will undoubtedly make you giggle or shake your head, but keep reading.
This is what I love about Žižek: he’s not a sycophantic liberal apologist, bouncing from philosophical points of contrition to smug “like, duh” assertions. (how’s that for high brow technical wording?) While I don’t always agree with him, I do respect him.
I almost deleted the previous sentence, but I’m deciding to leave it in to help me make another point, this time in the form of a question: why do we, at least us Westerners, tend to assume that we must always be in agreement or be enemies? “While I don’t always agree with..” is such a commonly used disclaimer; who on earth “always agree(s)” with anyone?
Just a thought. Back to rails now, though… I leave for Europe tonight and while I’m excited overall, I find myself in a state of nervous anticipation this morning. Perhaps that has something to do with the message I received from my couchsurfing.com host asking me where I was staying in the middle of the night if I was arriving at 2:30 in the morning on Friday. I’m not arriving in the middle of the night, of course, and I hope that I got that all cleared up with her through my response!! Fingers are crossed.
Wish me luck. More from London. Or Austria. Or.. Czech Republic. Til then, go read some Žižek!!!