Re: [rspec-users] how to stub the :current_user and any methods associated with it

2008-04-12 Thread newbie
Hey Jarkko, Thanks for the feedback. I tried your suggestion and it doesn't seem to work. To quickly recap I'm just testing in my controller that this works def index @entries = current_user.entries end describe "on the main page" do it "should show all the current entries for the user" do

Re: [rspec-users] Inspect STDERR in a story

2008-04-12 Thread Ashley Moran
On 12 Apr 2008, at 11:51, Edvard Majakari wrote: > How about something along the lines > > cd project_dir do > @stdout, @stdterr = capture_outputs("#{migrate} #{args}") > end > > ... > def capture_outputs(cmd) > stderr_log = "/tmp" + "/#{$0}-{$$}.log" > out = `cmd 2> #{stderr_log}

Re: [rspec-users] Rspecing this simple controller it is driving me mad...

2008-04-12 Thread roberto belardo
Uhm ok, i understood your answer but autotest did not. Better, this do not solves the problem. If i simply remove the "stub" and the "should_receive" for the author field, autotest will complain like this: Spec::Mocks::MockExpectationError in 'CommentsController handling POST /comments should crea

Re: [rspec-users] Inspect STDERR in a story

2008-04-12 Thread Edvard Majakari
On Sat, Apr 12, 2008 at 11:54 AM, Ashley Moran <[EMAIL PROTECTED]> wrote: > Hi > > I have a story step that looks like this: > >When /(the user|then) runs "migrate (.*)"/ do |_, args| > cd project_dir do >@output = `#{migrate} #{args}` > end >@output_lines = @output.s

Re: [rspec-users] request.params causing errors

2008-04-12 Thread Olivier Dupuis
It unfortunately access the wrong parameters. Instead of accessing the parameters from my url request, it access the parameters from my render_component. For example, my request is * http://localhost:4000/search/results?author=&keyword=&page=1&publisher=&title=agile * In that results view, I ren

[rspec-users] Inspect STDERR in a story

2008-04-12 Thread Ashley Moran
Hi I have a story step that looks like this: When /(the user|then) runs "migrate (.*)"/ do |_, args| cd project_dir do @output = `#{migrate} #{args}` end @output_lines = @output.split("\n") end Which is fine for testing STDOUT but not STDERR. I don't want to redi