Re: [rspec-users] Testing email w/ cucumber

2008-12-17 Thread aslak hellesoy
On Thu, Dec 18, 2008 at 5:37 AM, Ben Mabey wrote: > Mischa Fierer wrote: > >> Dear all, >> >> Wanted to let people know that Ben Mabey has an excellent little plugin >> here: http://github.com/bmabey/email-spec/tree/master >> > Thanks! > >> >> For testing e-mail. >> >> Aaron Gibralter made some

Re: [rspec-users] Testing email w/ cucumber

2008-12-17 Thread Ben Mabey
Mischa Fierer wrote: Dear all, Wanted to let people know that Ben Mabey has an excellent little plugin here: http://github.com/bmabey/email-spec/tree/master Thanks! For testing e-mail. Aaron Gibralter made some additions as well here: http://github.com/agibralter/email-spec/tree/master I

[rspec-users] Testing email w/ cucumber

2008-12-17 Thread Mischa Fierer
Dear all, Wanted to let people know that Ben Mabey has an excellent little plugin here: http://github.com/bmabey/email-spec/tree/master For testing e-mail. Aaron Gibralter made some additions as well here: http://github.com/agibralter/email-spec/tree/master I made some further changes here: ht

Re: [rspec-users] [Cucumber] a few clarifications please...

2008-12-17 Thread Zach Dennis
On Wed, Dec 17, 2008 at 8:30 PM, Steve Molitor wrote: > What about two steps with the same regex but are of different types -- i.e. > a Given and a Then with the same regexp? They do the exact same thing. Given|When|Then is just a nicety for you as the developer. Cucumber could care less. This is

Re: [rspec-users] fixtures and associations

2008-12-17 Thread Daniel Lopes
I think I was misunderstood. I am not saying to use create rather than create! ... In this case, I just use it because will help me with puts for debug my own error in spec. In this case a really don't know what is going on, if I use create! I can't store the value in a var and then try to look wha

Re: [rspec-users] fixtures and associations

2008-12-17 Thread aslak hellesoy
On Thu, Dec 18, 2008 at 2:02 AM, Daniel Lopes wrote: > I know... I just don't use create!, in this special case, because it will > be more complicate to know what field have the error . > No it won't. The error message tells you what field has the error, and if creation is unsuccessful you *need*

Re: [rspec-users] fixtures and associations

2008-12-17 Thread Daniel Lopes
I know... I just don't use create!, in this special case, because it will be more complicate to know what field have the error . I'm still scratching my head, my @tenant instance var on spec has values for user_id and owner_id and don't understand why my validates_associated :property raise an erro

Re: [rspec-users] [Cucumber] a few clarifications please...

2008-12-17 Thread Steve Molitor
What about two steps with the same regex but are of different types -- i.e. a Given and a Then with the same regexp? Steve On Wed, Dec 17, 2008 at 6:07 PM, aslak hellesoy wrote: > > > On Wed, Dec 17, 2008 at 11:50 PM, Tim Walker wrote: > >> Great information guys, making some progress on this en

Re: [rspec-users] fixtures and associations

2008-12-17 Thread aslak hellesoy
On Thu, Dec 18, 2008 at 1:38 AM, Daniel Lopes wrote: > Hello Pat, the error still the sa...@errors={"user"=>["can't be blank"]} > > But if we look on @base we have user: > @base=# ... > > > And my code is: > describe Tenant do > fixtures :properties, :users ,:owners > > def create_tenant(optio

Re: [rspec-users] fixtures and associations

2008-12-17 Thread Daniel Lopes
Hello Pat, the error still the sa...@errors={"user"=>["can't be blank"]} But if we look on @base we have user: @base=# And my code is: describe Tenant do fixtures :properties, :users ,:owners def create_tenant(options = {}) record = Tenant.create({ :property => properties(:two),

Re: [rspec-users] [Cucumber] a few clarifications please...

2008-12-17 Thread aslak hellesoy
On Wed, Dec 17, 2008 at 11:50 PM, Tim Walker wrote: > Great information guys, making some progress on this end. It is much > appreciated. > > Discovered that step definitions can not be duplicated even across > step files. Is this correct? > Regexen can not be the same (even if the blocks are di

Re: [rspec-users] fixtures and associations

2008-12-17 Thread Pat Maddox
On Wed, Dec 17, 2008 at 2:13 PM, Daniel Lopes wrote: > Hello Pat, even I load all my fixtures it still not reading anything from > users.yml ... > I will look at factory_girl but before I need understand what happening. > I try this: > require File.expand_path(File.dirname(__FILE__) + '/../spec_he

Re: [rspec-users] [Cucumber] a few clarifications please...

2008-12-17 Thread Ben Mabey
Tim Walker wrote: Great information guys, making some progress on this end. It is much appreciated. Discovered that step definitions can not be duplicated even across step files. Is this correct? Correct. They can't be duplicated in any given process, no mater what file(s) the definitions c

Re: [rspec-users] fixtures and associations

2008-12-17 Thread Matt Wynne
On 17 Dec 2008, at 21:07, Pat Maddox wrote: I highly recommend ditching fixtures all together. You avoid funky shit like this, and you won't have coupling between tests that occurs with fixtures, and you'll be able to create more clear specs because you do all the setup in the spec itself.

Re: [rspec-users] [Cucumber] a few clarifications please...

2008-12-17 Thread Tim Walker
Great information guys, making some progress on this end. It is much appreciated. Discovered that step definitions can not be duplicated even across step files. Is this correct? Thanks again. Sincerely, Tim On Wed, Dec 17, 2008 at 2:39 PM, Joseph Wilk wrote: > David Chelimsky wrote: >> >> On

Re: [rspec-users] Rails 2.3

2008-12-17 Thread Mischa Fierer
Thank you for clarifying. Yes, I mean edge rails. Best, M On Wed, Dec 17, 2008 at 4:01 AM, David Chelimsky wrote: > On Wed, Dec 17, 2008 at 3:39 AM, Mischa Fierer wrote: > > Wanted to point out to anyone having problems that rspec-rails 1.1.11.1 > > works with rails 2.3, while rspec 1.1.11 do

Re: [rspec-users] [Cucumber] a few clarifications please...

2008-12-17 Thread aslak hellesoy
On Wed, Dec 17, 2008 at 10:53 PM, David Chelimsky wrote: > On Wed, Dec 17, 2008 at 3:37 PM, Tim Walker wrote: > > Thank you David. This helps a lot. Question, if there are matching > > steps...will cucumber find the first matching step during execution? I > > noticed a test executing at higher li

Re: [rspec-users] [cucumber] before/after scenarios

2008-12-17 Thread Tim Walker
Joseph, This is very, very helpful and gets me to a place where I can try it. If anything, I just didn't think to look in "hooks" for the concept of setup/teardown. Really looking forward to the book! Many sincere thanks, I hope i can return the favor some day. Tim On Wed, Dec 17, 2008 at 2:23

Re: [rspec-users] [Cucumber] a few clarifications please...

2008-12-17 Thread Joseph Wilk
David Chelimsky wrote: On Wed, Dec 17, 2008 at 2:34 PM, Tim Walker wrote: Hi Guys, Things are working great with Cucumber and am getting better at expressing requirements as behaviors. Kudos! I seek a couple of points of clarification, or confirmation, if someone has a minute or two... FW

Re: [rspec-users] fixtures and associations

2008-12-17 Thread Daniel Lopes
Hello Pat, even I load all my fixtures it still not reading anything from users.yml ... I will look at factory_girl but before I need understand what happening. I try this: require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe Tenant do fixtures :properties, :users , :o

Re: [rspec-users] [cucumber] before/after scenarios

2008-12-17 Thread Joseph Wilk
Tim Walker wrote: Hi Guys, Sorry for the double-whine but I've seen references to these listeners but not a lot of luck finding any details. So...that's it: Setup/Teardown Before/After scenarios...what's the scoop? http://github.com/aslakhellesoy/cucumber/wikis/hooks Does the information h

Re: [rspec-users] [Cucumber] a few clarifications please...

2008-12-17 Thread David Chelimsky
On Wed, Dec 17, 2008 at 3:37 PM, Tim Walker wrote: > Thank you David. This helps a lot. Question, if there are matching > steps...will cucumber find the first matching step during execution? I > noticed a test executing at higher line numbers and then picking up a > step with a lower line number.

[rspec-users] [Cucumber] Autotest and multiple scenarios

2008-12-17 Thread Tim Walker
Hi Guys, Using AUTOFEATURE=true autospec and have a feature with multiple scenarios. When we save the feature or steps file AUTOTEST seems to only run the last scenario. Is this a known issue or are we doing something boneheaded, or both!? Thanks, Tim ___

Re: [rspec-users] [Cucumber] a few clarifications please...

2008-12-17 Thread Tim Walker
Thank you David. This helps a lot. Question, if there are matching steps...will cucumber find the first matching step during execution? I noticed a test executing at higher line numbers and then picking up a step with a lower line number. Thanks again, Tim On Wed, Dec 17, 2008 at 2:22 PM, David

Re: [rspec-users] [Cucumber] a few clarifications please...

2008-12-17 Thread David Chelimsky
On Wed, Dec 17, 2008 at 2:34 PM, Tim Walker wrote: > Hi Guys, > > Things are working great with Cucumber and am getting better at > expressing requirements as behaviors. Kudos! > > I seek a couple of points of clarification, or confirmation, if > someone has a minute or two... > > FWIW - I've read

Re: [rspec-users] [cucumber] before/after scenarios

2008-12-17 Thread Ben Mabey
Tim Walker wrote: Hi Guys, Sorry for the double-whine but I've seen references to these listeners but not a lot of luck finding any details. So...that's it: Setup/Teardown Before/After scenarios...what's the scoop? Thanks, Tim (Also, the logo's are looking awesome!) __

Re: [rspec-users] [cucumber] before/after scenarios

2008-12-17 Thread David Chelimsky
On Wed, Dec 17, 2008 at 3:14 PM, Tim Walker wrote: > Hi Guys, > > Sorry for the double-whine but I've seen references to these listeners > but not a lot of luck finding any details. > > So...that's it: Setup/Teardown Before/After scenarios...what's the scoop? That's it. > > Thanks, > > Tim > (Al

Re: [rspec-users] fixtures and associations

2008-12-17 Thread Pat Maddox
You are loading the users fixtures. You need to change your fixtures line to read fixtures :properties, :users (and any other models' fixtures you want to use) I highly recommend ditching fixtures all together. You avoid funky shit like this, and you won't have coupling between tests that occu

[rspec-users] [cucumber] before/after scenarios

2008-12-17 Thread Tim Walker
Hi Guys, Sorry for the double-whine but I've seen references to these listeners but not a lot of luck finding any details. So...that's it: Setup/Teardown Before/After scenarios...what's the scoop? Thanks, Tim (Also, the logo's are looking awesome!) __

[rspec-users] [Cucumber] a few clarifications please...

2008-12-17 Thread Tim Walker
Hi Guys, Things are working great with Cucumber and am getting better at expressing requirements as behaviors. Kudos! I seek a couple of points of clarification, or confirmation, if someone has a minute or two... FWIW - I've read the wiki and the given-when-then page and just seek confirmation:

Re: [rspec-users] fixtures and associations

2008-12-17 Thread Daniel Lopes
I get cannot be null error user in active record object... like below: properties(:two).valid? return false, but I don't understand why... because my properties.yml file is like below: two: user: aaron owner: tania address: Rua de teste address_number: 250 neighborhood: Bairro ABC ...

Re: [rspec-users] fixtures and associations

2008-12-17 Thread Pat Maddox
Hi Daniel, What happens when you do properties(:two).valid? p properties(:two).errors It looks like that fixture is not valid. Pat "Daniel Lopes" writes: > Hello David, the error is only in tenant_spec ... in property_spec all my > examples passed. The error is in "@tenant.errors.should be_

Re: [rspec-users] fixtures and associations

2008-12-17 Thread Daniel Lopes
Hello David, the error is only in tenant_spec ... in property_spec all my examples passed. The error is in "@tenant.errors.should be_empty" line and the message is expected empty? to return true, got false If I use puts to print my @tenant object before the assertion I get those values: #["is not

Re: [rspec-users] fixtures and associations

2008-12-17 Thread David Chelimsky
On Wed, Dec 17, 2008 at 12:37 PM, Daniel Lopes wrote: > Hello... I want ask for a help in error that don't understand. > I have properties model and tenants model. Tenant belongs to Property and > Property has many Tenants... I try this test association but allways get > "not valid" error for asso

[rspec-users] fixtures and associations

2008-12-17 Thread Daniel Lopes
Hello... I want ask for a help in error that don't understand. I have properties model and tenants model. Tenant belongs to Property and Property has many Tenants... I try this test association but allways get "not valid" error for association. Anyone can help? I post all my classes below: My Ten

Re: [rspec-users] Best practices for developing a rails plugin (extending ActiveRecord) with rspec?

2008-12-17 Thread Hendrik Volkmer
Hi Ingo, we use our own dry_plugin_test_helper [1] for almost all our plugin tests and it works fine. It provides a stripped down Rails environment inside the gem so that you don't need it in your plugin just to test your plugin code. We mainly use it with Test::Unit but I don't see why rspec would

Re: [rspec-users] Best practices for developing a rails plugin (extending ActiveRecord) with rspec?

2008-12-17 Thread Pat Maddox
Ingo Weiss writes: > Hi all, > > I am developing a rails plugin/gem with rspec. The plugin extends > ActiveRecord, so the specs basically needs a complete environment with > database access to run. What is a good way to set this up in a way > that can be bundled with the plugin, maybe in the form

Re: [rspec-users] step definitons to check login

2008-12-17 Thread David Chelimsky
On Wed, Dec 17, 2008 at 9:23 AM, James Byrne wrote: > Pat Maddox wrote: >> James Byrne writes: > >> >> I think Zach's point was that you can tell that someone is logged in if >> you see a "edit your profile" link somewhere, and they're not logged in >> if you see a "log in" link on the page. Yes

Re: [rspec-users] Best practices for developing a rails plugin (extending ActiveRecord) with rspec?

2008-12-17 Thread Scott Taylor
On Dec 17, 2008, at 10:26 AM, Ingo Weiss wrote: Hi all, I am developing a rails plugin/gem with rspec. The plugin extends ActiveRecord, so the specs basically needs a complete environment with database access to run. What is a good way to set this up in a way that can be bundled with the

[rspec-users] Best practices for developing a rails plugin (extending ActiveRecord) with rspec?

2008-12-17 Thread Ingo Weiss
Hi all, I am developing a rails plugin/gem with rspec. The plugin extends ActiveRecord, so the specs basically needs a complete environment with database access to run. What is a good way to set this up in a way that can be bundled with the plugin, maybe in the form of a stripped- down rai

Re: [rspec-users] step definitons to check login

2008-12-17 Thread James Byrne
Nicolás Sanguinetti wrote: > > Of course, a 30 second trip in google land would have led you to the > ruby documentation, where you'd have found a good explanation with > examples. Or, running `ri public` would've steered you in the right > direction. > > -foca > > /me wishes people used ri more

Re: [rspec-users] step definitons to check login

2008-12-17 Thread James Byrne
Pat Maddox wrote: > James Byrne writes: > > I think Zach's point was that you can tell that someone is logged in if > you see a "edit your profile" link somewhere, and they're not logged in > if you see a "log in" link on the page. Yes, of course it's useful to > know whether someone is authent

Re: [rspec-users] step definitons to check login

2008-12-17 Thread Nicolás Sanguinetti
Module#public (a private method) works in one of two ways: 1) it receives a list of symbols with method names, those methods are decorated as public. 2) it receives no arguments, in which case all methods defined from that point forward (until another visibility declaration is encountered in the cl

Re: [rspec-users] step definitons to check login

2008-12-17 Thread James Byrne
Re: authlogin Can someone familiar with this gem explain where and how the user_sessions are maintained? I have pawed through the code but it has left me rather more confused than not. The best inkling I can arrive at is that the authlogic persistence token is stored in the session data and

Re: [rspec-users] step definitons to check login

2008-12-17 Thread James Byrne
Andrew Premdas wrote: > Doing this for Restful-Authentication I add the following in > features/support/env.rb > > # Make visible for testing > ApplicationController.send(:public, :logged_in?, :current_user, > :authorized?) > Forgive my ignorance but would you do me the favour of explaining ex

Re: [rspec-users] step definitons to check login

2008-12-17 Thread Pat Maddox
James Byrne writes: > Zach Dennis wrote: >> On Tue, Dec 16, 2008 at 8:30 PM, Zach Dennis >> wrote: >>> >>> I know why you're doing it, but I just want to know *why* you're doing >>> it? Can you not tell through the application itself that someone is >>> logged in, logged out, and verify their i

Re: [rspec-users] step definitons to check login

2008-12-17 Thread James Byrne
Zach Dennis wrote: > On Tue, Dec 16, 2008 at 8:30 PM, Zach Dennis > wrote: >> >> I know why you're doing it, but I just want to know *why* you're doing >> it? Can you not tell through the application itself that someone is >> logged in, logged out, and verify their identity without having to >> e

Re: [rspec-users] Broken rake tasks

2008-12-17 Thread Ivor Paul
HI Andrew I am getting the same problem. I only get it when I install rspec-rails alongside rspec as gems. Did you get a resolution to this problem? Ivor On Thu, Dec 4, 2008 at 10:54 AM, Andrew Premdas wrote: > I've got a couple of rake tasks that seem to have broken with rspec 1.1.11. > http:

Re: [rspec-users] Wanna make the Cucumber Logo?

2008-12-17 Thread aslak hellesoy
On Tue, Dec 9, 2008 at 11:12 AM, aslak hellesoy wrote: > Check this out: > http://github.com/aslakhellesoy/cucumber/wikis/logo-contest > There is still time to enter the logo contest! So far I've received 3 great contributions. On Friday - exactly 48 hours from now I will set up a poll over the l

Re: [rspec-users] Rails 2.3

2008-12-17 Thread David Chelimsky
On Wed, Dec 17, 2008 at 3:39 AM, Mischa Fierer wrote: > Wanted to point out to anyone having problems that rspec-rails 1.1.11.1 > works with rails 2.3, while rspec 1.1.11 does not appear to. $ gem q -rn rails ... rails (2.2.2) ... Doesn't look like rails-2.3 is released. Do you mean edge rails?

[rspec-users] Rails 2.3

2008-12-17 Thread Mischa Fierer
Wanted to point out to anyone having problems that rspec-rails 1.1.11.1 works with rails 2.3, while rspec 1.1.11 does not appear to. Also, to get rspec 1.1.11.1 to build I had to remove UPDATE from the manifest. M ___ rspec-users mailing list rspec-user