[rspec-users] rspec doesnt recognize a custom mime type
timo.roessner at googlemail.com
Thu Apr 29 08:40:48 EDT 2010
fixed it, in a nutshell:
get :new, :format => :lightbox
get :new, :format => 'lightbox'
What was really confusing was that in BOTH cases the same URL appeared
in the log.
Here is my turn on what happened:
Internally - when rails sees a mime-type / format - rails
distinguishes between a string and a symbol, saying that when using
respond_to do |format|
"lightbox" is expected to be a string.
When doing a normal request via a browser I passed in the format in
the URL, so as a string.
When running a spec apparently this is passed directly the way I wrote
it, so as a symbol.
That's why one and the same URL worked in the browser, but not in my
Does this sound plausible?
More information about the rspec-users