Re: [rspec-users] Why won't my simple controller spec pass?

2009-05-15 Thread Lee
I have now managed to get the example to run as expected from The RSpec Book. I would appreciate pointers on the following though: > As an aside, I already have an implemented model that I'd like to use > in my controller spec. In this case, should I be using stub_model() to > make use of it e.g.

Re: [rspec-users] [Cucumber] Fail a scenario from After or AfterStep

2009-05-15 Thread Matt Wynne
On 15 May 2009, at 07:01, Luke Melia wrote: I'm trying to make sure that my cucumber selenium suite fails if my Rails app returns any 500 response codes. I'm working on what the best way to identify this state, but the question I'd like to put to the list is this: If I want to check for th

Re: [rspec-users] [Cucumber] Fail a scenario from After or AfterStep

2009-05-15 Thread aslak hellesoy
> I'm trying to make sure that my cucumber selenium suite fails if my Rails > app returns any 500 response codes. I'm working on what the best way to > identify this state, but the question I'd like to put to the list is this: > If I want to check for this error condition in an After or AfterStep,

[rspec-users] Cucumber broke my rake tasks! 0.3.5

2009-05-15 Thread Andrew Premdas
Seem to be having a problem with the new releases 0.3.5 which completely breaks my rake tasks http://gist.github.com/112149. WIth the t.fork = true # Explicitly fork for cucumber 0.3.4 and rails lines added to the tasks none of my steps are recognised (see second file in gists) Without t.fork

Re: [rspec-users] [Cucumber] Fail a scenario from After or AfterStep

2009-05-15 Thread Ben Lovell
On Fri, May 15, 2009 at 9:25 AM, aslak hellesoy wrote: > > I'm not so sure I like the idea of AfterStep - smells like a > workaround for something that belongs elsewhere. Can't your have > selenium-rc (or a helper method you create around it) raise those > exceptions? > > Given /bla/ do > # don't

[rspec-users] helpers for examples?

2009-05-15 Thread Denis Haskin
Where's the recommended place to put helper methods & etc for examples? I've started putting them in spec/spec_helper.rb but that's going to get awfully cluttered. I'm thinking maybe a spec/lib, and add that to include path? Or just put them in lib? I notice restful_authentication (I think)

Re: [rspec-users] [Cucumber] Fail a scenario from After or AfterStep

2009-05-15 Thread Luke Melia
On May 15, 2009, at 4:25 AM, aslak hellesoy wrote: To be honest, I don't remember what happened to AfterStep. I think we had it at some point, but can't see it in the codebase. Did I remove it? Or was that back in the pre-Cucumber days? Help me remember here... I'm not sure. I saw a reference

Re: [rspec-users] [Cucumber] Fail a scenario from After or AfterStep

2009-05-15 Thread aslak hellesoy
> On May 15, 2009, at 4:25 AM, aslak hellesoy wrote: > >> To be honest, I don't remember what happened to AfterStep. I think we >> had it at some point, but can't see it in the codebase. Did I remove >> it? Or was that back in the pre-Cucumber days? Help me remember >> here... > > I'm not sure. I s

[rspec-users] Passing user id to spec | error

2009-05-15 Thread manoah
-Controller -- def update @user = User.find_by_id( user.id ) if request.post? unless params[ :user ].nil? if @user.update_attributes( params[ :user ] ) redirect_to :action => :show end else render :st

Re: [rspec-users] How to test update_attribute with mocha?

2009-05-15 Thread Phlip
Matt Wynne wrote: On the other hand, if the tests fail for no good reason all the time because they're fragile, people may stop listening to them, and maybe eventually stop writing them. The argument I'm making is really just for slowing down and taking a little more care, with the eventual be

Re: [rspec-users] Passing user id to spec | error

2009-05-15 Thread David Chelimsky
On Fri, May 15, 2009 at 1:02 AM, manoah wrote: > >  -Controller -- > def update >   �...@user = User.find_by_id( user.id ) This uses user.id, not params[:id] >    if request.post? > >      unless params[ :user ].nil? > >        if @user.update_attributes( params[ :user ] ) >    

Re: [rspec-users] Cucumber broke my rake tasks! 0.3.5

2009-05-15 Thread Ben Mabey
Andrew Premdas wrote: Seem to be having a problem with the new releases 0.3.5 which completely breaks my rake tasks http://gist.github.com/112149. WIth the t.fork = true # Explicitly fork for cucumber 0.3.4 and rails lines added to the tasks none of my steps are recognised (see second file i

[rspec-users] Cucumber tables

2009-05-15 Thread James Byrne
I cannot seem to locate any documentation on how to implement the new table syntax otherwise I would not bother the list with this. I wish to write something like this: And we do have a forex rate for the following currency code and date |code |date| rate | |"USD"|"200

Re: [rspec-users] helpers for examples?

2009-05-15 Thread Zach Dennis
On Fri, May 15, 2009 at 9:04 AM, Denis Haskin wrote: > Where's the recommended place to put helper methods & etc for examples? > I've started putting them in spec/spec_helper.rb but that's going to get > awfully cluttered.  I'm thinking maybe a spec/lib, and add that to include > path?  Or just pu

Re: [rspec-users] helpers for examples?

2009-05-15 Thread Zach Dennis
On Fri, May 15, 2009 at 12:29 PM, Zach Dennis wrote: > On Fri, May 15, 2009 at 9:04 AM, Denis Haskin > wrote: >> Where's the recommended place to put helper methods & etc for examples? >> I've started putting them in spec/spec_helper.rb but that's going to get >> awfully cluttered.  I'm thinking

[rspec-users] Can I run the same specs with different gems? Ideas?

2009-05-15 Thread Rick DeNatale
I have a new icalendar Ruby library/gem which is implemented so as require an implementation of the TZInfo::Timezone class, but not to care whether that implementation comes from the tzinfo gem, or the activesupport gem in rails. It also will make use of the TimeWithZone class in recent versions o

Re: [rspec-users] [Cucumber] Fail a scenario from After or AfterStep

2009-05-15 Thread Luke Melia
On May 15, 2009, at 10:16 AM, aslak hellesoy wrote: Can you show me the code you would want to put in AfterStep that would detect a 500 error? I've written a simple piece of rack middleware (included below) that will create a file in the event a 500 is raised. I would clear the file before

Re: [rspec-users] helpers for examples?

2009-05-15 Thread Denis Haskin
I was just about to ask that. Thanks! dwh Zach Dennis wrote: On Fri, May 15, 2009 at 12:29 PM, Zach Dennis wrote: On Fri, May 15, 2009 at 9:04 AM, Denis Haskin wrote: Where's the recommended place to put helper methods & etc for examples? I've started putting them in spec/spec_h

Re: [rspec-users] Cucumber tables

2009-05-15 Thread Chris Flipse
On Fri, May 15, 2009 at 11:35 AM, James Byrne wrote: > I cannot seem to locate any documentation on how to implement the new > table syntax otherwise I would not bother the list with this. > > I wish to write something like this: > > And we do have a forex rate for the following currency code an

[rspec-users] [ANN] rSquery 0.1.1

2009-05-15 Thread Ivo Dancet
Hello all rSquery aims to reduce the difficulties involved in writing selenium tests in cucumber environments for webapps that use jQuery. The project contains several methods to help you with writing javascript commands for selenium and javascript based tests for cucumber or even rSpec.

Re: [rspec-users] Cucumber broke my rake tasks! 0.3.5

2009-05-15 Thread aslak hellesoy
> Andrew Premdas wrote: >> >> Seem to be having a problem with the new releases 0.3.5 which >> completely breaks my rake tasks http://gist.github.com/112149. >> >> WIth the >> >>  t.fork = true # Explicitly fork for cucumber 0.3.4 and rails >> >> lines added to the tasks none of my steps are recogn

Re: [rspec-users] Cucumber tables

2009-05-15 Thread aslak hellesoy
> I cannot seem to locate any documentation on how to implement the new > table syntax otherwise I would not bother the list with this. > I'm not sure what you mean by "new" table syntax. The syntax for tables hasn't really changed since it was introduced. > I wish to write something like this: >

Re: [rspec-users] Cucumber tables

2009-05-15 Thread James Byrne
I do not know if I am doing something wrong or not, but I am seeing evidence that feature tables in normal scenarios do not actually do anything. # feature statement And we do have a forex rate for "USD" on "2009-03-31" of "0.8666" | "USD" | "2009-04-01" | "0.8555" | | "USD" | "

[rspec-users] Creating an "integration controller" spec

2009-05-15 Thread Forrest Chang
Hi All: So I have some longer running controller specs that interact with outside API's that I want to move into an integration directory. In doing so, it seems I don't get the (possibly determined by directory?) magic that creates a ControllerExampleGroup, but rather a RailsExampleGroup. H

Re: [rspec-users] Cucumber tables

2009-05-15 Thread James Byrne
Aslak Hellesøy wrote: > http://wiki.github.com/aslakhellesoy/cucumber/scenario-outlines > > Please let us know what's missing or unclear about that. > That documentation is for scenario outlines. I had gathered that one could also simply use tables with regular scenarios where the table valu

Re: [rspec-users] Creating an "integration controller" spec

2009-05-15 Thread Zach Dennis
On Fri, May 15, 2009 at 2:15 PM, Forrest Chang wrote: > > Hi All: > > So I have some longer running controller specs that interact with outside > API's that I want to move into an integration directory.  In doing so, it > seems I don't get the (possibly determined by directory?) magic that creat

Re: [rspec-users] Cucumber tables

2009-05-15 Thread James Byrne
Chris Flipse wrote: > They're actually unrelated. Most of my table matchers have no other > regex in the expression > > You're not seeing anything else with the table data because you're not > doing > anything with the table data. > > Given /the following data rates/ do |table| > table.h

Re: [rspec-users] Creating an "integration controller" spec

2009-05-15 Thread David Chelimsky
On Fri, May 15, 2009 at 1:15 PM, Forrest Chang wrote: > > Hi All: > > So I have some longer running controller specs that interact with outside > API's that I want to move into an integration directory.  In doing so, it > seems I don't get the (possibly determined by directory?) magic that creat

Re: [rspec-users] [ANN] rSquery 0.1.1

2009-05-15 Thread aslak hellesoy
> Hello all > > rSquery aims to reduce the difficulties involved in writing selenium tests > in cucumber environments for webapps that use jQuery. > > The project contains several methods to help you with writing javascript > commands for selenium and javascript based tests for cucumber or even rSp

Re: [rspec-users] Cucumber tables

2009-05-15 Thread aslak hellesoy
> Aslak Hellesøy wrote: > >> http://wiki.github.com/aslakhellesoy/cucumber/scenario-outlines >> >> Please let us know what's missing or unclear about that. >> > > That documentation is for scenario outlines.  I had gathered that one > could also simply use tables with regular scenarios where the ta

Re: [rspec-users] [Cucumber] Fail a scenario from After or AfterStep

2009-05-15 Thread aslak hellesoy
> On May 15, 2009, at 10:16 AM, aslak hellesoy wrote: > >> Can you show me the code you would want to put in AfterStep that would >> detect a 500 error? > > I've written a simple piece of rack middleware (included below) that will > create a file in the event a 500 is raised. I would clear the file

Re: [rspec-users] Cucumber tables

2009-05-15 Thread aslak hellesoy
> Chris Flipse wrote: > >> They're actually unrelated.  Most of my table matchers have no other >> regex in the expression >> >> You're not seeing anything else with the table data because you're not >> doing >> anything with the table data. >> >>  Given /the following data rates/ do |table| >>    

Re: [rspec-users] Cucumber tables

2009-05-15 Thread James Byrne
Aslak Hellesøy wrote: >> sure that this is what I was doing, although the table followed a >> complete scenario. �However, I have not used tables for the last couple >> of months and am somewhat perplexed with respect to the changes. > > What are these changes you are talking about?? The only thin

Re: [rspec-users] Cucumber tables

2009-05-15 Thread aslak hellesoy
> Aslak Hellesøy wrote: >>> sure that this is what I was doing, although the table followed a >>> complete scenario. �However, I have not used tables for the last couple >>> of months and am somewhat perplexed with respect to the changes. >> >> What are these changes you are talking about?? The onl

Re: [rspec-users] [Cucumber] Fail a scenario from After or AfterStep

2009-05-15 Thread Luke Melia
On May 15, 2009, at 3:36 PM, aslak hellesoy wrote: Thanks for doing that. I have one more favour to ask: Can you show me an example of a StepDefinition that would cause the file to be created? That is a tougher question, because any browser interaction that causes an HTTP request to the app

Re: [rspec-users] [Cucumber] ANN: Cucumber 0.3.4

2009-05-15 Thread WJSimacek
On May 14, 10:04 am, Julian Leviston wrote: > On 15/05/2009, at 12:48 AM, aslak hellesoy wrote: > > >http://github.com/aslakhellesoy/cucumber/blob/173506c4013a7d733c5b492... > > > Enjoy! I just did an upgrade and came up with .0.3.5. The last entry I see on you list was .0.3.4 two days ago? Is

Re: [rspec-users] [Cucumber] ANN: Cucumber 0.3.4

2009-05-15 Thread WJSimacek
On May 14, 10:04 am, Julian Leviston wrote: > On 15/05/2009, at 12:48 AM, aslak hellesoy wrote: > > >http://github.com/aslakhellesoy/cucumber/blob/173506c4013a7d733c5b492... > > > Enjoy! > > __ Sorry I didn't read to the bottom and see that you also put in the . 0.3.5. Please excuse

Re: [rspec-users] Passing user id to spec | error

2009-05-15 Thread manoah
manoah wrote: > > -Controller -- > def update > @user = User.find_by_id( user.id ) > if request.post? > > unless params[ :user ].nil? > > if @user.update_attributes( params[ :user ] ) > redirect_to :action => :show > >

Re: [rspec-users] Passing user id to spec | error

2009-05-15 Thread manoah
manoah wrote: > > -Controller -- > def update > @user = User.find_by_id( user.id ) > if request.post? > > unless params[ :user ].nil? > > if @user.update_attributes( params[ :user ] ) > redirect_to :action => :show > >

[rspec-users] HowTo Specify A Method is Called Within A Controller's Action

2009-05-15 Thread Lee Longmore
I am new to RSpec and would appreciate some pointers on how to specify the following for my Rails application... I have a controller called ContextsController and, within this, the usual 'create' method. The first line of this method should be: @member = logged_in_member where logged_in_memb