00:57
ashley_moran joined
04:32
jschoolcraft joined
07:39
<technicalpickles>
foca: the way rspec 1.x does it is pretty hacky. iirc, it has something to do with the directory it's in. fortunately, it's one of the things that rspec 2 is trying to fix
08:31
<rsl>
i need to set request.host in an rspec/webrat integration test but google coming up short on help for this. anyone know how it's done?
08:31
<rsl>
i'd rather not append hostname to every visit call.
08:32
<rsl>
though i think i read that would work.
08:32
<malesca>
rsl: I have this in a cucumber step definition: host! domain
08:32
<malesca>
not sure exactly how that'd translate to rspec with webrat
08:32
<rsl>
malesca: yeah i saw that and tried it but it doesn't seem to do anything.
08:33
<rsl>
session and request are both nil objects in the before block where i'm setting this.
08:34
<malesca>
rsl: ah, yeah, seems you should do session.host!("
www.example.com"), so it makes sense that it wouldn't work without a session
08:35
<rsl>
might do something nasty for the moment until i can find the real solution.
08:35
<technicalpickles>
I'm pretty sure I've used just 'host! "blahblah.com"' before
08:35
<technicalpickles>
just remember that the World of cucumber tests are a rails integration test
08:36
<technicalpickles>
so, if you can find something for setting the host there, it should work in cucumber
08:36
<rsl>
technicalpickles: not using cuke. just rspec.
08:36
<technicalpickles>
ahh, alright. it's still an ActionController::TestCase :)
08:37
<dchelimsky>
rsl: what rails version?
08:37
<technicalpickles>
basically all the rspec-rails stuff wrap the appropriate TestCase, so controllers would get ActionController::TestCase, integration tests would get ActionController::IntegrationTest, etc
08:38
<rsl>
dchelimsky: rspec 1.2.9 and rails 2.3.5
08:38
<dchelimsky>
rsl: first, i'd upgrade to rspec-rails-1.3.2
08:39
<dchelimsky>
either way, though, you should be able to set headers on request.env
08:39
<rsl>
request is nil though. might be version issue. lemme upgrade and see.
08:41
<dchelimsky>
line 201
08:41
<dchelimsky>
that's a spec for rspec-rails-1.3.2
08:42
<dchelimsky>
rsl: warning ....
08:42
<dchelimsky>
you may end up shaving a yak or two upgrading
08:42
<dchelimsky>
but it's probably worth it
08:43
<dchelimsky>
in fact ....
08:43
<dchelimsky>
rails 2.3.5 was released after rspec-rails-1.2.9
08:44
<dchelimsky>
definitely good reason to upgrade
08:50
<rsl>
hrm upgrade went fine [didn't need to fix any tests] but still getting nil error for request in the before block.
08:50
<rsl>
reading in webrat source to see if anything jumps out.
08:54
<rsl>
thanks though to everyone so far.
10:03
<dchelimsky>
rsl: are you using before(:all)?
10:03
<rsl>
dchelimsky: no i was using before each
10:03
<rsl>
should i try that?
10:03
<dchelimsky>
wonder why that spec passes in rspec-rails' own specs
10:03
<rsl>
i never got it working though. i ended up setting an instance var for host and overriding visit to prepend the host name from the ivar.
10:03
<rsl>
hacky but worked.
10:04
<dchelimsky>
glad you got something working
10:04
<rsl>
thanks for the help though. yeah it's weird it doesn't work. i see AC::IntegrationTest in the ancestors but a lot of the methods seem to be awol.
11:26
charlenopires joined
12:39
<a2ron>
hi guys, i'm trying to use autospec and rspec together to run specs on a rails project. the trouble is, autospec won't run my specs. It just outputs "loading autotest/rails_rspec"
12:39
<a2ron>
I can run the specs fine with 'rake spec'
12:45
<a2ron>
nvm, figured it out. needed a .autotest file with the correct file. thanks.
14:12
bcardarella_ joined
14:50
<anlek>
How can I add a new folder (spec/observers) into the load_path for rspec to see it?
15:00
BrianTheCoder joined
15:07
<adamaig>
anlek: what have you tried?
15:07
<anlek>
I tried add_hook, but I just noticed that my ~/.autotest wasn't being read when calling autospec --rails
15:07
<anlek>
I tried a lot more, but this is where I'm at now
15:07
charlenopires joined
15:08
<adamaig>
hmm i thought that rspec looked for all **/*_spec.rb so simply creating the directory w/ specs works if the directory is under app
15:09
<anlek>
when I call 'spec spec', it does. But when autospec calls it, it sends a list of files/folders
15:12
<anlek>
adamaig: I was able to figure it out, I pretty much coppeid "/usr/local/lib/ruby/gems/1.8/gems/rspec-rails-1.3.2/lib/autotest/rails_rspec.rb" into my ~/.autotest and tweaked it with my extra folders.
15:18
<adamaig>
seems like that could be globbed better
17:06
BrianTheCoder joined