Re: [rspec-users] Help with regexp in matcher

2009-01-16 Thread Matt Wynne
On 15 Jan 2009, at 22:13, James Byrne wrote: We have, in consequence, gone through and removed the term login from all code use as well; replacing it with authenticate. So, for example, the authentication form now says: To Proceed Please Authenticate Yourself I am sometimes (ok, mostly)

Re: [rspec-users] OT: Who To Ask About Screw.Unit?

2009-01-16 Thread Matt Wynne
On 16 Jan 2009, at 06:58, Scott Taylor wrote: s.ross wrote: On Jan 15, 2009, at 7:24 AM, Mike Gaffney wrote: s.ross's email about Screw.Unit brought prompted me to ask this question: 1) What do you use for Javascript Unit testing? I've tried jsspec and Screw.Unit and so far I'm

Re: [rspec-users] Cucumber HTML in IE6

2009-01-16 Thread aidy lewis
Hi Guys, 2009/1/15 aslak hellesoy aslak.helle...@gmail.com: On Thu, Jan 15, 2009 at 9:25 PM, Mischa Fierer f.mis...@gmail.com wrote: While I agree that ie6 must die, the fix required to make it work sounds minimal in this case. I may be wrong. Perhaps, Aidy, you would be interested in

[rspec-users] Step tables - Writing the block for a have_selector matcher

2009-01-16 Thread Juanma Cervera
Ok. I have solved my problem. Because I am using spanish for wrinting my features, I didn't paste the exact sentences of the code I was using, and pasted instead a manual-translated similar code. And nobody could see the problem. Never more. The problem was that I was writing the block for

[rspec-users] rspec model testing - test on user defined validation- How do I test that the create failed.

2009-01-16 Thread Ken Wegener
I'm new to rspec and looking for way to test a validation I added to a model. The test checks to see that if field1 has a value then field2 must be nil and vice versa. --- When I did the rspec_scaffold it generated one test which worked before :each do

Re: [rspec-users] GivenScenario in cucumber

2009-01-16 Thread Bart Zonneveld
On 15 jan 2009, at 23:24, Joseph Wilk wrote: Bart Zonneveld wrote: Hey all, I've read http://rspec.lighthouseapp.com/projects/16211-cucumber/tickets/3-%20%20create-givenscenario-dependency-accross-feature-file , and would like to share another idea about this. I'm building a blog at the

Re: [rspec-users] OT: Who To Ask About Screw.Unit?

2009-01-16 Thread Mike Gaffney
We're trying to get one of them up at work and we're currently adding selenium grid support to webrat. I was thinking of building a glue plugin on one of these frameworks so that they would just run as a webrat test via a rake task. Would anyone be interested in somthing like that if we

Re: [rspec-users] Documentation about the returns method

2009-01-16 Thread Fernando Perez
David Chelimsky wrote: On Wed, Jan 14, 2009 at 3:53 PM, Fernando Perez li...@ruby-forum.com wrote: Here are my questions: - What does the returns(Episode.all) mean? Okay I get it now. Thank you very much. -- Posted via http://www.ruby-forum.com/.

Re: [rspec-users] rspec model testing - test on user defined validation- How do I test that the create failed.

2009-01-16 Thread Pat Maddox
On Fri, Jan 16, 2009 at 3:29 AM, Ken Wegener kgwco...@yahoo.com wrote: I'm new to rspec and looking for way to test a validation I added to a model. The test checks to see that if field1 has a value then field2 must be nil and vice versa. --- When I did the

Re: [rspec-users] Which webrat gem should be used?

2009-01-16 Thread James Byrne
Aslak Hellesøy wrote: If you're on Rails and use RSpec matchers, the latest official webrat 0.3.4 gem is broken. It doesn't contain the webrat/rspec-rails.rb file (a packaging bug). If you feel adventurous then, after installing cucumber-0.3.4, you could create a file with this content:

[rspec-users] driving rspec from a Ruby script

2009-01-16 Thread Ed Keith
I have very little experience with Ruby. I am using RSpec to test a cross platform C++ library. I am using a shell script (and batch file) to run the tests with several different compilers. I do no want to put the details of the different compilers in the RSpec files, but am thinking about

[rspec-users] Testing arbitrary post action parameters

2009-01-16 Thread James Byrne
I am working on our (newly renamed) authentication feature. The current scenario is: Scenario: Non-administrators should not set administrator ability Given I have no users And I add a user named admin as an administrator And I add a user named myuser as not an administrator

Re: [rspec-users] Which webrat gem should be used?

2009-01-16 Thread Pat Maddox
On Fri, Jan 16, 2009 at 8:59 AM, James Byrne li...@ruby-forum.com wrote: Aslak Hellesøy wrote: If you're on Rails and use RSpec matchers, the latest official webrat 0.3.4 gem is broken. It doesn't contain the webrat/rspec-rails.rb file (a packaging bug). If you feel adventurous then, after

Re: [rspec-users] Testing arbitrary post action parameters

2009-01-16 Thread Pat Maddox
On Fri, Jan 16, 2009 at 10:00 AM, James Byrne li...@ruby-forum.com wrote: I am working on our (newly renamed) authentication feature. The current scenario is: Scenario: Non-administrators should not set administrator ability Given I have no users And I add a user named admin as an

Re: [rspec-users] rspec model testing - test on user defined validation- How do I test that the create failed.

2009-01-16 Thread Wegener Ken
Solved my problem all the examples I could find had the following example myTest.should_not_be_valid but that method wasn't a valid method. It appears the method has been refactored and the new form is mytest.should_not(be_valid) which does work following test does what I want it should not

Re: [rspec-users] Testing arbitrary post action parameters

2009-01-16 Thread James Byrne
James Byrne wrote: Now, what I am looking for is an example of how an authenticated user would craft a post request in their browser to set the user.administrator flag to true. OK, I figured out how to do this, as an authenticated user, from the browser. I am now going to try the syntax

Re: [rspec-users] Testing arbitrary post action parameters

2009-01-16 Thread James Byrne
Pat Maddox wrote: I assume you don't though, cause that'd be kinda weird. How about passing it in the POST params: put users_url(user), :user = {:administrator = true} Something along those lines... That is the problem, I am not sure what syntax to use int the step definition. I tried

[rspec-users] Weird progress bar failure on unrelated spec

2009-01-16 Thread Ashley Moran
Hi Before I try to recreate this, does anyone know what generally causes this in a progress spec run? /opt/local/lib/ruby/gems/1.8/gems/ rspec-1.1.12/lib/spec/runner/formatter/progress_bar_formatter.rb:25:in `flush': Bad file descriptor (Errno::EBADF) from

[rspec-users] App can't start on production server due to RSpec missing

2009-01-16 Thread Fernando Perez
Hi, I just run in the following problem when starting a Rails app on my production server: You have rspec rake tasks installed in /home/thomas/rails_apps/video_on_demand/lib/tasks/rspec.rake, but rspec can not be found in vendor/gems, vendor/plugins or on the system. Obviously I don't

Re: [rspec-users] App can't start on production server due to RSpec missing

2009-01-16 Thread Scott Taylor
On Jan 16, 2009, at 2:38 PM, Fernando Perez wrote: Hi, I just run in the following problem when starting a Rails app on my production server: You have rspec rake tasks installed in /home/thomas/rails_apps/video_on_demand/lib/tasks/rspec.rake, but rspec can not be found in vendor/gems,

Re: [rspec-users] Testing arbitrary post action parameters

2009-01-16 Thread Zach Dennis
In the past we've done the following: Story: Users without hierarchy manager role accessing the hierarchy In order to ensure users that shouldn't have access to the hierarchy don't As a user who isn't a hierarchy manager I should not be able to access the hierarchy Scenario: Non

Re: [rspec-users] driving rspec from a Ruby script

2009-01-16 Thread Ashley Moran
On 16 Jan 2009, at 17:44, Ed Keith wrote: I have very little experience with Ruby. I am using RSpec to test a cross platform C++ library. I am using a shell script (and batch file) to run the tests with several different compilers. I do no want to put the details of the different compilers in

Re: [rspec-users] App can't start on production server due to RSpec missing

2009-01-16 Thread David Chelimsky
On Fri, Jan 16, 2009 at 1:38 PM, Fernando Perez li...@ruby-forum.com wrote: Hi, I just run in the following problem when starting a Rails app on my production server: You have rspec rake tasks installed in /home/thomas/rails_apps/video_on_demand/lib/tasks/rspec.rake, but rspec can not

Re: [rspec-users] rspec model testing - test on user defined validation- How do I test that the create failed.

2009-01-16 Thread Pat Maddox
On Fri, Jan 16, 2009 at 8:51 AM, Wegener Ken kgwco...@yahoo.com wrote: Solved my problem all the examples I could find had the following example myTest.should_not_be_valid but that method wasn't a valid method. It appears the method has been refactored and the new form is

Re: [rspec-users] App can't start on production server due to RSpec missing

2009-01-16 Thread aslak hellesoy
On Fri, Jan 16, 2009 at 10:05 PM, David Chelimsky dchelim...@gmail.comwrote: On Fri, Jan 16, 2009 at 1:38 PM, Fernando Perez li...@ruby-forum.com wrote: Hi, I just run in the following problem when starting a Rails app on my production server: You have rspec rake tasks installed in

Re: [rspec-users] App can't start on production server due to RSpec missing

2009-01-16 Thread Stephen Eley
On Fri, Jan 16, 2009 at 2:38 PM, Fernando Perez li...@ruby-forum.com wrote: A quick fix is to install rspec and rspec-rails gems on production server, but I don't get why the app wants them installed. Because every Rake file in /lib gets loaded when you run Rake. That's your dependency

Re: [rspec-users] Testing file attachment with Paperclip

2009-01-16 Thread Fernando Perez
Nicholas Wieland wrote: Does someone have an example on faking a file upload for just ensuring it gets called, without actually uploading the file to s3. I thought that stubbing Model.has_attached_file would be enough, but it doesn't seem so ... This is what I did: Video.stub!(

Re: [rspec-users] Weird progress bar failure on unrelated spec

2009-01-16 Thread Ashley Moran
Just as an addendum to that, it also exhibits freezing behaviour on one of the specs (presumably the same) with just the one line in place. (It just hangs indefinitely during the progress output.) Don't expect anyone will be able to figure this out without seeing all the code, so I'm

Re: [rspec-users] App can't start on production server due to RSpec missing

2009-01-16 Thread Fernando Perez
I would delete that rake task file (lib/rspec.rake) if you don't have rspec installed. Scott I run rspec on my dev machine, but obviously not on my production machine, what would be the nicest way to handle such scenario? At the top of rspec.rake I could add a check on the environment, I

Re: [rspec-users] Testing arbitrary post action parameters

2009-01-16 Thread James Byrne
Zach Dennis wrote: The Then step ensures that the user is redirected to an access denied page. Granted, this doesn't go the granularity you may be trying to get at, but knowing you aren't actually getting through to the underlying action (by being redirected to the access denied page) has

Re: [rspec-users] App can't start on production server due to RSpec missing

2009-01-16 Thread Mark Wilden
On Fri, Jan 16, 2009 at 1:15 PM, Fernando Perez li...@ruby-forum.comwrote: I run rspec on my dev machine, but obviously not on my production machine, what would be the nicest way to handle such scenario? At the top of rspec.rake I could add a check on the environment That would get my vote.

Re: [rspec-users] Testing arbitrary post action parameters

2009-01-16 Thread Pat Maddox
On Fri, Jan 16, 2009 at 12:25 PM, James Byrne li...@ruby-forum.com wrote: Pat Maddox wrote: I assume you don't though, cause that'd be kinda weird. How about passing it in the POST params: put users_url(user), :user = {:administrator = true} Something along those lines... That is the

Re: [rspec-users] App can't start on production server due to RSpec missing

2009-01-16 Thread David Chelimsky
On Fri, Jan 16, 2009 at 5:06 PM, Mark Wilden m...@mwilden.com wrote: On Fri, Jan 16, 2009 at 1:15 PM, Fernando Perez li...@ruby-forum.com wrote: I run rspec on my dev machine, but obviously not on my production machine, what would be the nicest way to handle such scenario? At the top of

Re: [rspec-users] App can't start on production server due to RSpec missing

2009-01-16 Thread David Chelimsky
On Fri, Jan 16, 2009 at 4:15 PM, aslak hellesoy aslak.helle...@gmail.com wrote: On Fri, Jan 16, 2009 at 10:05 PM, David Chelimsky dchelim...@gmail.com wrote: On Fri, Jan 16, 2009 at 1:38 PM, Fernando Perez li...@ruby-forum.com wrote: Hi, I just run in the following problem when

Re: [rspec-users] newbie: errors getting started with cucumber

2009-01-16 Thread Fernando Perez
Aslak Hellesøy wrote: On Thu, Dec 25, 2008 at 2:04 PM, Manasi Vora li...@ruby-forum.com wrote: I am using webrat 0.3.2 cucumber 0.1.13 activerecord 2.1.1 You need a newer webrat - for example gem install aslakhellesoy-webrat Aslak Thanks that help me out. It installed 0.3.2.2 which

Re: [rspec-users] App can't start on production server due to RSpec missing

2009-01-16 Thread Pat Maddox
On Fri, Jan 16, 2009 at 2:58 PM, David Chelimsky dchelim...@gmail.com wrote: On Fri, Jan 16, 2009 at 4:15 PM, aslak hellesoy aslak.helle...@gmail.com wrote: On Fri, Jan 16, 2009 at 10:05 PM, David Chelimsky dchelim...@gmail.com wrote: On Fri, Jan 16, 2009 at 1:38 PM, Fernando Perez

Re: [rspec-users] App can't start on production server due to RSpec missing

2009-01-16 Thread Mark Wilden
On Fri, Jan 16, 2009 at 3:19 PM, David Chelimsky dchelim...@gmail.comwrote: I run rspec on my dev machine, but obviously not on my production machine, what would be the nicest way to handle such scenario? At the top of rspec.rake I could add a check on the environment That would get

Re: [rspec-users] App can't start on production server due to RSpec missing

2009-01-16 Thread Scott Taylor
On Jan 16, 2009, at 4:15 PM, Fernando Perez wrote: I would delete that rake task file (lib/rspec.rake) if you don't have rspec installed. Scott I run rspec on my dev machine, but obviously not on my production machine, what would be the nicest way to handle such scenario? At the top of

Re: [rspec-users] newbie: errors getting started with cucumber

2009-01-16 Thread Nick Hoffman
On 2009-01-16, at 17:19, Fernando Perez wrote: Aslak Hellesøy wrote: On Thu, Dec 25, 2008 at 2:04 PM, Manasi Vora li...@ruby-forum.com wrote: I am using webrat 0.3.2 cucumber 0.1.13 activerecord 2.1.1 You need a newer webrat - for example gem install aslakhellesoy- webrat Aslak

Re: [rspec-users] Testing file attachment with Paperclip

2009-01-16 Thread Nick Hoffman
On 2009-01-16, at 17:42, Fernando Perez wrote: Nicholas Wieland wrote: Does someone have an example on faking a file upload for just ensuring it gets called, without actually uploading the file to s3. I thought that stubbing Model.has_attached_file would be enough, but it doesn't seem so ...