Re: [rspec-users] how do I mock the Rails Logger with should_receive?

2008-06-24 Thread Mikel Lindsaar
On Fri, Jun 13, 2008 at 8:56 AM, john <[EMAIL PROTECTED]> wrote: > I'm trying to mock the Rails Logger for the following code: > rescue TimeoutError => error > $logger.error("#{self.name} Timeout for #{path}: #{error}") and return > rescue SocketError => error > $logger.error("#

Re: [rspec-users] DRY up story

2008-06-24 Thread David Chelimsky
On Jun 24, 2008, at 4:31 PM, Rick DeNatale wrote: On Tue, Jun 24, 2008 at 3:00 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: On Jun 24, 2008, at 1:54 PM, Yi Wen wrote: In David's presentation @ RailsConf, he has this example: Story: measure progress towards registration goals As a conferenc

Re: [rspec-users] DRY up story

2008-06-24 Thread Rick DeNatale
On Tue, Jun 24, 2008 at 3:00 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Jun 24, 2008, at 1:54 PM, Yi Wen wrote: > > In David's presentation @ RailsConf, he has this example: >> >> Story: measure progress towards registration goals >> As a conference organizer >> I want to see a report of

Re: [rspec-users] Mocking MiddleMan

2008-06-24 Thread s.ross
On Jun 23, 2008, at 6:54 PM, Pat Maddox wrote: From what I remember, the problem is that backgroundrb starts some stuff as soon as you reference MiddleMan. So even though you're stubbing the call to actually perform work, there's some other stuff that goes on behind the scenes before you're ev

Re: [rspec-users] DRY up story

2008-06-24 Thread David Chelimsky
On Jun 24, 2008, at 1:54 PM, Yi Wen wrote: In David's presentation @ RailsConf, he has this example: Story: measure progress towards registration goals As a conference organizer I want to see a report of registrations So that I can measure progress towards registration goals Scenario: one regi

[rspec-users] DRY up story

2008-06-24 Thread Yi Wen
In David's presentation @ RailsConf, he has this example: Story: measure progress towards registration goals As a conference organizer I want to see a report of registrations So that I can measure progress towards registration goals Scenario: one registration shows as 1% Given a goal of 200 regis

Re: [rspec-users] Story HTML output

2008-06-24 Thread Ben Mabey
Yi Wen wrote: Hi, If I write the HTML format stories output to ~/ccrb_build-build_number/Stories/index.html. To get all styles rendered, I also need to copy /vendor/plugins/rspec/story_server/prototype/stylesheets/ and /vendor/plugins/rspec/story_server/prototype/javascripts/ to the ~/ccrb_build

[rspec-users] Story HTML output

2008-06-24 Thread Yi Wen
Hi, If I write the HTML format stories output to ~/ccrb_build-build_number/Stories/index.html. To get all styles rendered, I also need to copy /vendor/plugins/rspec/story_server/prototype/stylesheets/ and /vendor/plugins/rspec/story_server/prototype/javascripts/ to the ~/ccrb_build-build_number/St

Re: [rspec-users] Rspec-Rails setting a header in stories?

2008-06-24 Thread Matthew Rudy Jacobs
David Chelimsky wrote: > On Jun 24, 2008, at 10:22 AM, Matthew Rudy Jacobs wrote: > >> Hi there, >> >> For my api controllers I need the following; >> request.ssl? == true >> and >> an api key "request.env['HTTP_OUR_API_KEY']" >> >> In my spec/controllers I just stub out the required code >> but i

Re: [rspec-users] Suggestions on how to use stub_model with webrat?

2008-06-24 Thread David Chelimsky
On Jun 24, 2008, at 10:39 AM, Danny Sofer wrote: Hi all, I am using story runner with webrat, but I am not sure how to incorporate stub_model into my tests. I'd recommend avoiding this. Stories are for integration testing. Examples are for isolation - that's where you want to be stubbing

[rspec-users] Suggestions on how to use stub_model with webrat?

2008-06-24 Thread Danny Sofer
Hi all, I am using story runner with webrat, but I am not sure how to incorporate stub_model into my tests. The webrat steps only care about the user interface and have nothing to say about interaction with the database. Following Ben Mabey, I have a line in my story like: "When clicks t

Re: [rspec-users] Rspec-Rails setting a header in stories?

2008-06-24 Thread Matthew Rudy Jacobs
David Chelimsky wrote: > On Jun 24, 2008, at 10:22 AM, Matthew Rudy Jacobs wrote: > >> Hi there, >> >> For my api controllers I need the following; >> request.ssl? == true >> and >> an api key "request.env['HTTP_OUR_API_KEY']" >> >> In my spec/controllers I just stub out the required code >> but i

Re: [rspec-users] Rspec-Rails setting a header in stories?

2008-06-24 Thread David Chelimsky
On Jun 24, 2008, at 10:22 AM, Matthew Rudy Jacobs wrote: Hi there, For my api controllers I need the following; request.ssl? == true and an api key "request.env['HTTP_OUR_API_KEY']" In my spec/controllers I just stub out the required code but in stories I don't want any stubs. Stories wrap R

[rspec-users] Rspec-Rails setting a header in stories?

2008-06-24 Thread Matthew Rudy Jacobs
Hi there, For my api controllers I need the following; request.ssl? == true and an api key "request.env['HTTP_OUR_API_KEY']" In my spec/controllers I just stub out the required code but in stories I don't want any stubs. I've tried changing the .env of the existing request, but this doesn't work

Re: [rspec-users] before_save model callback rspec testing

2008-06-24 Thread Csongor Bartus
Yi Wen wrote: > That's because you executed the same creation code into the > script/console, which has nothing to do with RSpec, and still get the > same error message, right? > > Yi Gotcha :D It seems I've got tired ... Thanks a lot! -- Posted via http://www.ruby-forum.com/. __

Re: [rspec-users] before_save model callback rspec testing

2008-06-24 Thread Yi Wen
That's because you executed the same creation code into the script/console, which has nothing to do with RSpec, and still get the same error message, right? Yi On Tue, Jun 24, 2008 at 2:56 AM, Csongor Bartus <[EMAIL PROTECTED]> wrote: > Yi Wen wrote: >> Well, at least now we know this is nothing

Re: [rspec-users] before_save model callback rspec testing

2008-06-24 Thread Csongor Bartus
Yi Wen wrote: > Well, at least now we know this is nothing to do with RSpec. My > suggestion is that you comment out the code which will be executed > during a creation, bit by bit in User (such as before_save) and try to > create a user. In this way you can pinpoint where the problem is. Thanks a