[rspec-users] Trouble with (Rails) Nested Model Directories

2009-03-06 Thread mudphone
Hi folks, In order to bring some order to the many model classes that I have under /app/models, I'm created a new directory (for example): /app/models/nestdir I've added the required configuration line in environment.rb: config.load_paths += %W( #{RAILS_ROOT}/app/models/nestdir ) But, when I r

Re: [rspec-users] Can I construct the controller myself in a controller spec?

2009-03-06 Thread Matt Wynne
On 5 Mar 2009, at 15:24, Ben Mabey wrote: David Chelimsky wrote: On Thu, Mar 5, 2009 at 3:31 AM, Matt Wynne wrote: Maybe we should make this easier by providing some facility in the mock framework to express the following in one statement: @authenticator = stub('authenticator') Authenticat

[rspec-users] have_tag + quantity - question

2009-03-06 Thread MAwiniarski
Greetings, Is there a way to check quantity of tags? Something like this: response.should have_tag('div').quantity(4) Thanks. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] be_valid (validates_format_of ..., :on => :create)

2009-03-06 Thread MAwiniarski
> FWIW, the OP's code says :on => :create. I also happened to > seehttp://mawiniarski.wordpress.com/2009/02/28/rspec-validation-on-create/, > which reinforced for me that this is about validating on create, not > general validation. I've figured that out after starting a topic. _

[rspec-users] rspec 1.1.99.10 rails 2.3 - help needed

2009-03-06 Thread Rick
I checked first and found no conversation that matched my problem so here it is: I'm trying to get rspec going on ruby 1.9.1 / rails 2.3.0 - here's my current gem list: *** LOCAL GEMS *** actionmailer (2.3.0) actionpack (2.3.0) activerecord (2.3.0) activeresource (2.3.0) activesupport (2.3.0) co

Re: [rspec-users] have_tag + quantity - question

2009-03-06 Thread David Chelimsky
On Thu, Mar 5, 2009 at 7:40 AM, MAwiniarski wrote: > Greetings, > > Is there a way to check quantity of tags? > > Something like this: > > response.should have_tag('div').quantity(4) response.should have_tag('div', 4) Check the assert_select docs (have_tag wraps it) at http://api.rubyonrails.org

Re: [rspec-users] Cucumber + Webrat + Selenium + ActionMailer

2009-03-06 Thread Manasi v
> Yeap everything worked like a charm, once again checking email contents > like there is no tomorrow ;-) > > Rai > -- > Posted via http://www.ruby-forum.com/. > ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailm

Re: [rspec-users] rspec 1.1.99.10 rails 2.3 - help needed

2009-03-06 Thread David Chelimsky
On Wed, Mar 4, 2009 at 3:14 PM, Rick wrote: > I checked first and found no conversation that matched my problem so > here it is: > > I'm trying to get rspec going on ruby 1.9.1 / rails 2.3.0 - here's my > current gem list: rspec-rails does not yet work with Ruby 1.9.1 - this is one item on a rath

Re: [rspec-users] Trouble with (Rails) Nested Model Directories

2009-03-06 Thread David Chelimsky
On Thu, Mar 5, 2009 at 4:02 PM, mudphone wrote: > Hi folks, > > In order to bring some order to the many model classes that I have > under /app/models, I'm created a new directory (for example): > /app/models/nestdir > > I've added the required configuration line in environment.rb: >  config.load_

[rspec-users] Help make rspec-1.2 a smooth upgrade

2009-03-06 Thread David Chelimsky
Hi all, I'm planning to release rspec-1.2 and rspec-rails-1.2 shortly after rails-2.3 goes final (rails-2.3.1 was just released as RC2). There are a couple of loose ends right now, and I need your help in two important areas. I've curtailed releasing github gems, so please clone, build and install

Re: [rspec-users] Cucumber + Webrat + Selenium + ActionMailer

2009-03-06 Thread Raimond Garcia
Manasi Vora wrote: >> >> > > > Hi Rai, > > Good that you have found a solution.. > > but I still don't understand why you want to test sending mails from the > browser. In my project, we use Cucumber + Webrat for writing functional > features. > and Cucumber + selenium for acceptance features

Re: [rspec-users] Cucumber 0.2 final release date?

2009-03-06 Thread Tom Ten thij
> I'm afraid I can't give a release date. 0.2 is fixed(ish) scope, and > therefore time can't be fixed at the same time. I have a lot of travel > the next month, so it will take a least a month I'm afraid. I know I for one would sure like to see 0.2 come out soon. The scope of the two 0.2 ticket

Re: [rspec-users] have_tag + quantity - question

2009-03-06 Thread Mark Wilden
On Thu, Mar 5, 2009 at 5:40 AM, MAwiniarski wrote: > Greetings, > > Is there a way to check quantity of tags? > > Something like this: > > response.should have_tag('div').quantity(4) Another great resource is http://labnotes.org/svn/public/ruby/rails_plugins/assert_select/cheat/assert_select.html

[rspec-users] Webrat - Fill in text field by id

2009-03-06 Thread Steve Molitor
Is there a way to locate and 'fill in' a text field (or check a check box, select an option, etc.) by id? It seems that the fill_in method takes either the text of the label pointing to the field or the field name. The are cases when writing cucumber steps when using the HTML id of the input elem

Re: [rspec-users] Webrat - Fill in text field by id

2009-03-06 Thread Yi
It does take id. At least in the trunk webrat On Fri, Mar 6, 2009 at 10:23 AM, Steve Molitor wrote: > Is there a way to locate and 'fill in' a text field (or check a check box, > select an option, etc.) by id? It seems that the fill_in method takes > either the text of the label pointing to the

Re: [rspec-users] Webrat - Fill in text field by id

2009-03-06 Thread James Byrne
Steve Molitor wrote: > Is there a way to locate and 'fill in' a text field (or check a check > box, > select an option, etc.) by id? It seems that the fill_in method takes > either the text of the label pointing to the field or the field name. > The > are cases when writing cucumber steps when u

Re: [rspec-users] Webrat - Fill in text field by id

2009-03-06 Thread James Byrne
James Byrne wrote: S/B > > click_button("test_this_id") -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Can I construct the controller myself in a controller spec?

2009-03-06 Thread Zach Dennis
On Fri, Mar 6, 2009 at 3:05 AM, Matt Wynne wrote: > > On 5 Mar 2009, at 15:24, Ben Mabey wrote: > >> David Chelimsky wrote: >>> >>> On Thu, Mar 5, 2009 at 3:31 AM, Matt Wynne wrote: >>> Maybe we should make this easier by providing some facility in the >>> mock framework to express the following

Re: [rspec-users] Webrat - Fill in text field by id

2009-03-06 Thread Steve Molitor
Well I'm reading the 0.4.2 webrat rdoc for fill_in, at it says: "field can be either the value of a name attribute (i.e. user[email]) or the text inside a element that points at the field." Does it also try the id? Steve On Fri, Mar 6, 2009 at 11:03 AM, James Byrne wrote: > Steve Molitor wrot

Re: [rspec-users] have_tag + quantity - question

2009-03-06 Thread Stephen Eley
On Fri, Mar 6, 2009 at 3:55 AM, David Chelimsky wrote: > On Thu, Mar 5, 2009 at 7:40 AM, MAwiniarski wrote: >> >> Is there a way to check quantity of tags? > > response.should have_tag('div', 4) Ooh! Thank you; I wish I'd known that before. All this time I've been using annoyingly complicated

Re: [rspec-users] Webrat - Fill in text field by id

2009-03-06 Thread Stephen Eley
On Fri, Mar 6, 2009 at 2:22 PM, Steve Molitor wrote: > Well I'm reading the 0.4.2 webrat rdoc for fill_in, at it says: > "field can be either the value of a name attribute (i.e. user[email]) or the > text inside a element that points at the  field." > Does it also try the id? Try it! (Or read th

Re: [rspec-users] Webrat - Fill in text field by id

2009-03-06 Thread Yi
Could you just try it? On Fri, Mar 6, 2009 at 1:22 PM, Steve Molitor wrote: > Well I'm reading the 0.4.2 webrat rdoc for fill_in, at it says: > "field can be either the value of a name attribute (i.e. user[email]) or > the text inside a element that points at the field." > > Does it also try the

Re: [rspec-users] have_tag + quantity - question

2009-03-06 Thread Pat Nakajima
I've posted it on this list before, but if you're writing view tests, check out Elementor: http://pivotallabs.com/users/patn/blog/articles/608-better-view-testing-with-elementor. It provides a much cleaner way of asserting on markup, and doesn't require you to litter your expectations with CSS sele

[rspec-users] Shared behaviors in Cucumber?

2009-03-06 Thread Sebastian W.
Hello RSpec group, is there a way to do RSpec-style shared behaviors in Cucumber? Or something similar? -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Shared behaviors in Cucumber?

2009-03-06 Thread Matt Wynne
You have Background in the new 0.2 version (not released yet) which lets you specify some Given steps for all the scenarios in a feature. Other than that there's the super-steps, which also give you really nice re-use: http://blog.mattwynne.net/2008/11/14/dry-up-your-cucumber-steps/ On 6 M

Re: [rspec-users] Shared behaviors in Cucumber?

2009-03-06 Thread Ben Mabey
Matt Wynne wrote: You have Background in the new 0.2 version (not released yet) which lets you specify some Given steps for all the scenarios in a feature. Other than that there's the super-steps, which also give you really nice re-use: http://blog.mattwynne.net/2008/11/14/dry-up-your-cucumbe

Re: [rspec-users] Shared behaviors in Cucumber?

2009-03-06 Thread Matt Wynne
On 6 Mar 2009, at 23:35, Ben Mabey wrote: Matt Wynne wrote: You have Background in the new 0.2 version (not released yet) which lets you specify some Given steps for all the scenarios in a feature. Other than that there's the super-steps, which also give you really nice re-use: http://bl

[rspec-users] what has RSpec got against stack traces?

2009-03-06 Thread Phlip
Here's an error message. The details are not important (beyond to_xml on a virtual AR database via fixture_dependencies). I know how to work the actual problem. NoMethodError in 'BlogMindMap should create XML' undefined method `macro' for nil:NilClass spec/blog_mind_map_spec.rb:192: spe

Re: [rspec-users] what has RSpec got against stack traces?

2009-03-06 Thread Scott Taylor
Phlip wrote: Here's an error message. The details are not important (beyond to_xml on a virtual AR database via fixture_dependencies). I know how to work the actual problem. NoMethodError in 'BlogMindMap should create XML' undefined method `macro' for nil:NilClass spec/blog_mind_map_spec

Re: [rspec-users] what has RSpec got against stack traces?

2009-03-06 Thread Phlip
The question is why did RSpec throw away the backtrace? Am I the first person in history to hit a programming error inside RSpec?? Nope, but this probably isn't one of them. I said it wrong. The complete venting goes "Am I the first person in history to use RSpec, and then hit a programming