Re: [rspec-users] Cucumber - How to enable a disabled field

2009-02-10 Thread Pat Maddox
You have to go through the browser, using something like selenium (which can be driven by cucumber) Pat On 2/10/09, Tom Hoen wrote: > Is there way in Cucumber to enable a field or submit button that was > disabled by default (:disable => true). I have a submit button which is > enabled using ja

Re: [rspec-users] issues with the trunk of rspec-rails

2009-02-10 Thread David Chelimsky
On Tue, Feb 10, 2009 at 10:49 PM, David Chelimsky wrote: > On Tue, Feb 10, 2009 at 2:02 PM, Nathan Wilmes wrote: >> Hi folks, >> >> I'm currently in the process of upgrading an old Rails project to the Rails >> 2.2.2 and the trunk of RSpec, and ran into several issues with rspec-rails. >> I've co

Re: [rspec-users] issues with the trunk of rspec-rails

2009-02-10 Thread Josh Knowles
On Tue, Feb 10, 2009 at 3:02 PM, Nathan Wilmes wrote: > Hi folks, > > I'm currently in the process of upgrading an old Rails project to the Rails > 2.2.2 and the trunk of RSpec, and ran into several issues with rspec-rails. > I've come up with workarounds for all of them, but I wanted to report th

Re: [rspec-users] exemplary way to show a list is sorted?

2009-02-10 Thread Zach Dennis
On Tue, Feb 10, 2009 at 10:09 PM, James Byrne wrote: > Zach Dennis wrote: >> On Tue, Feb 10, 2009 at 6:22 PM, James Byrne >> wrote: >>> David Chelimsky wrote: >>> please use "should be >=" as "should >=" will eventually be deprecated and removed. >>> >>> Removed? You are not

Re: [rspec-users] Weird message on ActiveSupport::Callbacks::CallbackChain:Class

2009-02-10 Thread David Chelimsky
On Tue, Feb 10, 2009 at 9:03 AM, Remi Gagnon wrote: > Hi guys, > > its probably a miss understanding of the framework but I need your > assistance. > > Here is the problem of one of my teammates: > I have a hard time writing rspecs for a class I developed. The class in > question reads an xml docu

Re: [rspec-users] how can this pass?

2009-02-10 Thread Sergio Bayona
Pat Maddox wrote: > On Mon, Feb 9, 2009 at 10:18 PM, Sergio Bayona > wrote: >> >> other is an AR object. But, shouldn't it return the mock property? >> []) >>respond_to do |format| >> got: #> nil, zip: nil, uasap: nil, tax_number: nil, rent_due: nil, units_count: >> 0, issues_count:

Re: [rspec-users] issues with the trunk of rspec-rails

2009-02-10 Thread David Chelimsky
On Tue, Feb 10, 2009 at 2:02 PM, Nathan Wilmes wrote: > Hi folks, > > I'm currently in the process of upgrading an old Rails project to the Rails > 2.2.2 and the trunk of RSpec, and ran into several issues with rspec-rails. > I've come up with workarounds for all of them, but I wanted to report th

Re: [rspec-users] exemplary way to show a list is sorted?

2009-02-10 Thread David Chelimsky
On Tue, Feb 10, 2009 at 9:09 PM, James Byrne wrote: > Zach Dennis wrote: >> On Tue, Feb 10, 2009 at 6:22 PM, James Byrne >> wrote: >>> David Chelimsky wrote: >>> please use "should be >=" as "should >=" will eventually be deprecated and removed. >>> >>> Removed? You are not s

Re: [rspec-users] Bizarre problem with Rake / Rcov

2009-02-10 Thread David Chelimsky
On Tue, Feb 10, 2009 at 5:24 PM, James Byrne wrote: > James Byrne wrote: > >> >> Where and How is this constant getting its value changed? The evidence >> indicates that the array R_RCOV_BASIC_OPTS has the contents of rcov_opta >> appended each time that the factory method is called but I cannot

[rspec-users] Cucumber - How to enable a disabled field

2009-02-10 Thread Tom Hoen
Is there way in Cucumber to enable a field or submit button that was disabled by default (:disable => true). I have a submit button which is enabled using javascript and would like to test the page using Cucumber. Thanks for your advice, Tom -- Posted via http://www.ruby-forum.com/. _

Re: [rspec-users] exemplary way to show a list is sorted?

2009-02-10 Thread James Byrne
Zach Dennis wrote: > On Tue, Feb 10, 2009 at 6:22 PM, James Byrne > wrote: >> David Chelimsky wrote: >> >>> >>> please use "should be >=" as "should >=" will eventually be deprecated >>> and removed. >>> >> >> Removed? You are not seriously contemplating forcing people to go back >> and rewrite

[rspec-users] [cucumber] [alpha] The Backgrounder is run without cleaning up

2009-02-10 Thread Chris Flipse
This /could/ just a screwy behavior I'm seeing in SQL lite, but I don't think so; normal scenarios are doing this just fine. I'm playing with the Background feature in the .1.99 beta, and it looks like it's being run before every feature -- but it's not cleaning up afterwards. I have a model with

Re: [rspec-users] exemplary way to show a list is sorted?

2009-02-10 Thread Zach Dennis
On Tue, Feb 10, 2009 at 6:22 PM, James Byrne wrote: > David Chelimsky wrote: > >> >> please use "should be >=" as "should >=" will eventually be deprecated >> and removed. >> > > Removed? You are not seriously contemplating forcing people to go back > and rewrite formally working specifications s

Re: [rspec-users] Pass a variable from rake to steps file in cucumber

2009-02-10 Thread aslak hellesoy
On Tue, Feb 10, 2009 at 11:30 PM, David Chelimsky wrote: > On Tue, Feb 10, 2009 at 2:42 PM, aslak hellesoy > wrote: >> dude. have you lost your memory? didn't we have this conversation a week ago? >> >> http://www.nabble.com/-Cucumber--and-rake-pass-command-line-params-tt21789574.html > > Sorry -

Re: [rspec-users] exemplary way to show a list is sorted?

2009-02-10 Thread James Byrne
David Chelimsky wrote: > > please use "should be >=" as "should >=" will eventually be deprecated > and removed. > Removed? You are not seriously contemplating forcing people to go back and rewrite formally working specifications simply to tidy up the syntax are you? -- Posted via http://ww

Re: [rspec-users] Pass a variable from rake to steps file in cucumber

2009-02-10 Thread David Chelimsky
On Tue, Feb 10, 2009 at 2:42 PM, aslak hellesoy wrote: > dude. have you lost your memory? didn't we have this conversation a week ago? > > http://www.nabble.com/-Cucumber--and-rake-pass-command-line-params-tt21789574.html Sorry - my fault - was going back through some email that was pending moder

Re: [rspec-users] Bizarre problem with Rake / Rcov

2009-02-10 Thread James Byrne
James Byrne wrote: > > Where and How is this constant getting its value changed? The evidence > indicates that the array R_RCOV_BASIC_OPTS has the contents of rcov_opta > appended each time that the factory method is called but I cannot see > where or how this is happening. > t.rcov_opts

Re: [rspec-users] issues with the trunk of rspec-rails

2009-02-10 Thread Pat Nakajima
> > (3) with_tag is completely broken, as it tries to use the outer class as > the subject of 'with_tag', rather than the have_tag matcher that it lives > inside. > If you're testing markup (view tests or whatever), take a look at my elementor project[1]. I've found that it makes view testing a lo

Re: [rspec-users] resource urls only work *after* a get() in controller spec

2009-02-10 Thread David Chelimsky
On Tue, Feb 10, 2009 at 3:23 PM, wrote: > > Done: > > http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/692-route-based-_url-or-_path-functions-dont-work-until-getpost-are-called Great. Thx. > > > Randy > > > - Original Message >> From: David Chelimsky >> To: rspec-users >>

Re: [rspec-users] Pass a variable from rake to steps file in cucumber

2009-02-10 Thread aslak hellesoy
dude. have you lost your memory? didn't we have this conversation a week ago? http://www.nabble.com/-Cucumber--and-rake-pass-command-line-params-tt21789574.html aslak On Fri, Jan 30, 2009 at 1:26 PM, AndreXP wrote: > > Can anybody tell me how to pass a variable from the rake command to my steps

Re: [rspec-users] exemplary way to show a list is sorted?

2009-02-10 Thread Pat Maddox
On Tue, Feb 10, 2009 at 12:19 PM, David Chelimsky wrote: > Right. I've done stuff like this before: > > [b,d,a,c].sort_with_special_method.should == [a,b,c,d] > > Any other patterns out there? That's how I do it. Pat ___ rspec-users mailing list rspec-

[rspec-users] issues with the trunk of rspec-rails

2009-02-10 Thread Nathan Wilmes
Hi folks, I'm currently in the process of upgrading an old Rails project to the Rails 2.2.2 and the trunk of RSpec, and ran into several issues with rspec-rails. I've come up with workarounds for all of them, but I wanted to report them to hopefully get them into better shape for other folks. (1)

[rspec-users] [ANN] IRC rooms are now logged

2009-02-10 Thread Ben Mabey
Hey all, Thanks to Chris Schneider the #rspec, #cucumber, and #webrat freenode rooms are all being logged now! The logs can be found here: http://irclogger.com/ The code is all on github[1] so if you would like to add/change something just fork it and send a pull request to Chris. If you se

Re: [rspec-users] resource urls only work *after* a get() in controller spec

2009-02-10 Thread r_j_h_box-sf
Done: http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/692-route-based-_url-or-_path-functions-dont-work-until-getpost-are-called Randy - Original Message > From: David Chelimsky > To: rspec-users > Sent: Tuesday, February 10, 2009 12:15:48 PM > Subject: Re: [rspec-users]

Re: [rspec-users] exemplary way to show a list is sorted?

2009-02-10 Thread David Chelimsky
On Sun, Feb 8, 2009 at 5:48 PM, Phlip wrote: > RSpeckers: > > I'm asserting that a list should be sorted by affinity. The following In BDD we say "expecting" instead of "asserting" > code is good enough for government work, but is there some more clever > way to show that each element is equal o

Re: [rspec-users] resource urls only work *after* a get() in controller spec

2009-02-10 Thread David Chelimsky
On Mon, Feb 2, 2009 at 12:17 AM, Randy Harmon wrote: > > Okay, following up on this item. Would you believe a workaround of (gasp) > get :index, prior to expecting route-based URLs to work? (slaps forehead). > or do_action(), provided by the host example group (the more concrete example > gr

[rspec-users] How to spec within a block?

2009-02-10 Thread rgagnon
I have this and I want to mock the to_xml but not his block cause this is what I want to spec. Is there a way to do this? Sorry for the formatting output = @detenteur.to_xml( :skip_types => false, :skip_instruct => true, :dasherize => false, :only => [:inte_no] ) do |xml_detenteur|

[rspec-users] exemplary way to show a list is sorted?

2009-02-10 Thread Phlip
RSpeckers: I'm asserting that a list should be sorted by affinity. The following code is good enough for government work, but is there some more clever way to show that each element is equal or less than the previous element? it 'should rank posts by affinity' do list = @map.sort_frobs_by_a

Re: [rspec-users] Rspec fails

2009-02-10 Thread David Chelimsky
On Tue, Jan 27, 2009 at 8:04 PM, melvin ram wrote: > >From this code http://pastie.org/372777 I'm getting these errors > http://pastie.org/372702 and it's not making any sense... and it's got > me a little stuck. > > Some help pls? To start with, the code uses rspec's mock syntax, but the errors

[rspec-users] (no subject)

2009-02-10 Thread Randy Harmon
I'm encountering an interesting symptom during example execution. I'm making a shared example group that dries up belongs-to-me before_filter testing, and it makes a callback to the example group that says it_should_behave_like that. The callback tells the shared example where to expect a red

Re: [rspec-users] resource urls only work *after* a get() in controller spec

2009-02-10 Thread Randy Harmon
Okay, following up on this item. Would you believe a workaround of (gasp) get :index, prior to expecting route-based URLs to work? (slaps forehead). or do_action(), provided by the host example group (the more concrete example group, I mean - what's the right terminology there?). I tried re

Re: [rspec-users] how can this pass?

2009-02-10 Thread Pradeep Gatram
Sergio, Responding to your original question. This issue has bugged me a lot in the past 1 year. And apparently, a lot of other people. As already explained, the spec should indeed pass. But there should be a failure somewhere because your code will obviously not work. Synthesis is a great tool f

Re: [rspec-users] [Rails] [ANN] The RSpec Book is now in beta

2009-02-10 Thread Robby Russell
...and the crowd roars! On Thu, Jan 29, 2009 at 7:36 AM, David Chelimsky wrote: > > I'm pleased to announce the beta release of the Pragmatic Bookshelf's > The RSpec Book: Behaviour Driven Development with RSpec, Cucumber and > Friends! > > It's been a long time coming, and there's still a lot of

[rspec-users] Weird message on ActiveSupport::Callbacks::CallbackChain:Class

2009-02-10 Thread Remi Gagnon
Hi guys, its probably a miss understanding of the framework but I need your assistance. Here is the problem of one of my teammates: I have a hard time writing rspecs for a class I developed. The class in question reads an xml document, instanciates the model classes found in the xml and saves th

[rspec-users] Rspec fails

2009-02-10 Thread melvin ram
>From this code http://pastie.org/372777 I'm getting these errors http://pastie.org/372702 and it's not making any sense... and it's got me a little stuck. Some help pls? ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman

[rspec-users] Problem with refresh_specs

2009-02-10 Thread jschank
Hello, I recently unpacked the latest (1.1.12) rspec and rspec rails in my applicaiton. When I run my specs I get: config.gem: Unpacked gem rspec-1.1.12 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this. config.gem: Unpacked gem rspec-rails-1.1.12 in vendor/gems h

[rspec-users] How to test the code inside the block of the to_xml function?

2009-02-10 Thread Alex
Hi all, when I spec the to_xml function like this: @some_model.should_receive(:to_xml), it dskips the code located in the block, here is the controller code: ... output = @detenteur.to_xml( :skip_types => false, :skip_instruct => true, :dasherize => false, :only => [:inte_no] ) do |xml_detenteur|

Re: [rspec-users] The TODO note in rspec files can't be shown in "rake notes"

2009-02-10 Thread steveluscher
On Dec 10 2008, 7:12 pm, "Kai Fu" wrote: > Could someone tell me how to fix this? Whether I should hack the rails rake > code? I've written about my (hopefully) durable solution to your problem, here: http://steveluscher.com/archives/enumerating-annotations-in-directories-of-your-choosing-with-r

[rspec-users] RSpec testing AR results

2009-02-10 Thread James Byrne
The TDD/BDD stuff is really quite amazing. In order to construct tests on a library that I wrote to implement custom magic columns I have learned some extremely valuable information respecting date and time recording in Rails. Which leads to my question: I am presently testing an AR stored time o

Re: [rspec-users] Using cucumber profiles with rake task

2009-02-10 Thread Francisco Trindade
Thanks, now it makes sense. Regards, Francisco Zach Dennis wrote: > On Tue, Feb 10, 2009 at 10:27 AM, Francisco Trindade > wrote: >> task. I followed the advice given on this thread >> >> elements from the cucumber profile. >> >> Am I missing something? >> > > The Cucumber rake task doesn't su

Re: [rspec-users] Using cucumber profiles with rake task

2009-02-10 Thread Zach Dennis
On Tue, Feb 10, 2009 at 10:27 AM, Francisco Trindade wrote: > Hi, > > Im trying to set up an environment where I am able to run different > cucumber profiles (webrat/selenium) in the same project. > > I did manage to make them work using the cucumber command, so this > command works: > cucumber -p

[rspec-users] Weird message on ActiveSupport::Callbacks::CallbackChain:Class

2009-02-10 Thread Remi Gagnon
Hi guys, its probably a miss understanding of the framework but I need your assistance. Here is the problem of one of my teammates: I have a hard time writing rspecs for a class I developed. The class in question reads an xml document, instanciates the model classes found in the xml and saves the

[rspec-users] Using cucumber profiles with rake task

2009-02-10 Thread Francisco Trindade
Hi, Im trying to set up an environment where I am able to run different cucumber profiles (webrat/selenium) in the same project. I did manage to make them work using the cucumber command, so this command works: cucumber -p selenium features/done/items_selenium.feature The problem I have is when

Re: [rspec-users] how can this pass?

2009-02-10 Thread Mark Wilden
On Mon, Feb 9, 2009 at 10:18 PM, Sergio Bayona wrote: > describe "responding to GET new" do > >it "should expose a new property as @property" do > @account = mock_model(Account) > @account.should_receive(:properties) > @property = mock_model(Property, :new_record? => false, :er

Re: [rspec-users] how can this pass?

2009-02-10 Thread Pat Maddox
On Mon, Feb 9, 2009 at 10:18 PM, Sergio Bayona wrote: > Mark Wilden wrote: >> On Sun, Feb 8, 2009 at 6:54 PM, Sergio Bayona >> wrote: >> >>> > On Mon, Feb 9, 2009 at 2:35 AM, Sergio Bayona >>> > wrote: >>> >> >>> >>assigns[:property].should equal(mock_property) >>> >> 1 example, 0 failur