[rspec-users] rSpec, Selenium and screenshots

2008-04-08 Thread Bart Zonneveld
Hey list, I'm currently playing with the selenium acceptance test-thingies, and I want to build something that saves a screenshot when a test fails. However, I have no clue whatsoever where to implement this. I'm thinking it should be along the line of: - apply a general after_each, in which w

Re: [rspec-users] rSpec, Selenium and screenshots

2008-04-08 Thread Andrew WC Brown
Doesn't Selenium already do that? Mine takes screenshots on failure. On Tue, Apr 8, 2008 at 6:25 AM, Bart Zonneveld <[EMAIL PROTECTED]> wrote: > Hey list, > > I'm currently playing with the selenium acceptance test-thingies, and > I want to build something that saves a screenshot when a test fail

Re: [rspec-users] rSpec, Selenium and screenshots

2008-04-08 Thread David Chelimsky
On Tue, Apr 8, 2008 at 6:29 AM, Andrew WC Brown <[EMAIL PROTECTED]> wrote: > On Tue, Apr 8, 2008 at 6:25 AM, Bart Zonneveld <[EMAIL PROTECTED]> > wrote: > > > Hey list, > > > > I'm currently playing with the selenium acceptance test-thingies, and > > I want to build something that saves a screensh

Re: [rspec-users] rspec controller action list

2008-04-08 Thread Phillip Koebbe
I'm a complete rSpec newbie, so I might be stepping in somewhere that I don't belong, but... Namatra, you said earlier that you were stubbing during setup, and you shared the before_post method. In the spec, though, you are going a :get. I'm not familiar with testing controllers yet (just get

Re: [rspec-users] rspec controller action list

2008-04-08 Thread Phillip Koebbe
Phillip Koebbe wrote: > > Namatra, Sorry, I spelled your name wrong. Namrata Peace, Phillip -- 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] rSpec, Selenium and screenshots

2008-04-08 Thread Mark Ryall
If you're using mac os x, you could give http://mosquito.the.tool.googlepages.com a try. On Tue, Apr 8, 2008 at 9:27 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Tue, Apr 8, 2008 at 6:29 AM, Andrew WC Brown <[EMAIL PROTECTED]> > wrote: > > > On Tue, Apr 8, 2008 at 6:25 AM, Bart Zonneveld <

Re: [rspec-users] rSpec, Selenium and screenshots

2008-04-08 Thread Andrew WC Brown
I used Selenium with Rpsec less than a month ago.Could you not just roll back a few version? On Tue, Apr 8, 2008 at 7:49 AM, Mark Ryall <[EMAIL PROTECTED]> wrote: > If you're using mac os x, you could give > http://mosquito.the.tool.googlepages.com a try. > > On Tue, Apr 8, 2008 at 9:27 PM, David

Re: [rspec-users] rSpec, Selenium and screenshots

2008-04-08 Thread Bart Zonneveld
On 8-apr-2008, at 14:03, Andrew WC Brown wrote: > I used Selenium with Rpsec less than a month ago. > Could you not just roll back a few version? Nah, I'd rather ditch selenium altogether. It doesn't play that very nice with Safari, and Firefox needs too much time to start up. I guess I'll stic

[rspec-users] TextMate bundle not using environment variable to find Ruby library

2008-04-08 Thread SoManyFishes
Something is going on in my TextMate bundle--it's calling the wrong lib for Ruby. I have the environment variables set like this: > > TM_RSPEC_HOME /usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.3 > TM_RUBY /usr/local/bin/ruby When I run these queries in a TextMate window I get this: > which rub

[rspec-users] how to mock/stub restful_authenticated and acl2-ized actions

2008-04-08 Thread Giuseppe Bertini
Dear all, I am wondering how to properly mock/stub out the preliminary steps to actions protected by restful_authentication and acl_system2 (role-based authorization to execute actions). Here's my setup: class User < ActiveRecord::Base has_and_belongs_to_many :roles has_many :tasks [snip] e

[rspec-users] Can you add an option to select the ruby interpreter for rake task?

2008-04-08 Thread Chiyuan Zhang
Hi all, My problem is that I've installed both ruby 1.8 (as ruby) and ruby 1.9 (as ruby1.9) on my system. I use spec/rake/spectask for my Rakefile. But the generated command is ruby -I.. blabla it should be "ruby1.9 -I... blabla", but after look at the code of spectask.rb, I found this line:

Re: [rspec-users] how to mock/stub restful_authenticated and acl2-ized actions

2008-04-08 Thread Glenn Ford
While my approach might not be the best, since I don't stub :login_required, it still serves me well. I would do something like this: user = mock_model(User, :operator => true) controller.stub!(:current_user).and_return(user) login_required will find the 'current_user' and be happy. I don't

Re: [rspec-users] Can you add an option to select the ruby interpreter for rake task?

2008-04-08 Thread Pat Maddox
On Tue, Apr 8, 2008 at 8:53 AM, Chiyuan Zhang <[EMAIL PROTECTED]> wrote: > The "ruby" is hard-coded into it. May I request this to be an > customizable option so that I can set it to "ruby1.9"? Please file a ticket at http://rspec.lighthouseapp.com Pat __

Re: [rspec-users] Can you add an option to select the ruby interpreter for rake task?

2008-04-08 Thread Chiyuan Zhang
OK, done: http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/370-add-an-option-for-rake-task-to-select-ruby-interpreter On Wed, Apr 9, 2008 at 12:21 AM, Pat Maddox <[EMAIL PROTECTED]> wrote: > On Tue, Apr 8, 2008 at 8:53 AM, Chiyuan Zhang <[EMAIL PROTECTED]> wrote: > > The "ruby" is har

Re: [rspec-users] Advice / Turning a Usecase into a Rspec Story / Granularity ofstories

2008-04-08 Thread Corey Haines
+1 on sheer awesomeness of this presentation! Thanks for sending the slides out! We are struggling/actively discussing our use of plain text stories, and this really adds a lot to our conversation. thanks. -Corey On Thu, Apr 3, 2008 at 8:31 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Thu,

Re: [rspec-users] Rspecing this simple controller it is driving me mad...

2008-04-08 Thread roberto belardo
Everything seemed so fine, but when i tried to investigate a little i discovered this tremendous behaviour of the spec: --- CommentsController def create @comment = Comment.new(params[:comment]) @user = User.find(params[:user_id]) @comment.author = 'foobar'

Re: [rspec-users] how to mock/stub restful_authenticated and acl2-ized act

2008-04-08 Thread Giuseppe Bertini
Hi Glenn, thanks for the response. > I would do something like this: > > user = mock_model(User, :operator => true) > controller.stub!(:current_user).and_return(user) OK, so, :operator is not a User attribute. Rather, a user is an operator, so to speak, if a habtm relationship exists between the

Re: [rspec-users] how to mock/stub restful_authenticated and acl2-ized act

2008-04-08 Thread Jarkko Laine
On 8.4.2008, at 23.17, Giuseppe Bertini wrote: Hi Glenn, thanks for the response. I would do something like this: user = mock_model(User, :operator => true) controller.stub!(:current_user).and_return(user) OK, so, :operator is not a User attribute. Rather, a user is an operator, so to spea

Re: [rspec-users] Rspecing this simple controller it is driving me mad...

2008-04-08 Thread Jarkko Laine
On 8.4.2008, at 23.06, roberto belardo wrote: Everything seemed so fine, but when i tried to investigate a little i discovered this tremendous behaviour of the spec: --- CommentsController def create @comment = Comment.new(params[:comment]) @user = User.find(param

Re: [rspec-users] how to mock/stub restful_authenticated and acl2-ized act

2008-04-08 Thread Giuseppe Bertini
Hi Jarkko, I see your point. However, checking the user's roles in order to authorize access to the action is done behind the scenes by the acl_system2 plugin, which would not know what to do with has_role?, unless I am missing something. Thanks! Giuseppe > You might want to take that one step

Re: [rspec-users] Autotest RSpec Not Running on Model Save's?

2008-04-08 Thread Fischer, Daniel
Yea a fix would be amazing. This is knda annoying because now I have to press ctrl-c or something to run that spec. On Sun, Apr 6, 2008 at 12:36 PM, Willem Källman <[EMAIL PROTECTED]> wrote: > Same problem here, but I guess it has nothing to do with RSpec or the > fact that you are testing a mode

Re: [rspec-users] how to mock/stub restful_authenticated and acl2-ized actions

2008-04-08 Thread Chris Flipse
On Tue, Apr 8, 2008 at 10:03 AM, Giuseppe Bertini <[EMAIL PROTECTED]> wrote: > Dear all, > > I am wondering how to properly mock/stub out the preliminary steps to > actions protected by restful_authentication and acl_system2 (role-based > authorization to execute actions). Here's my setup: > I us

[rspec-users] i can haz buk?

2008-04-08 Thread George Anderson
David, Aslak, Any word on the most eagerly anticipated book ever? /g -- George Anderson BenevolentCode LLC ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] i can haz buk?

2008-04-08 Thread David Chelimsky
On Tue, Apr 8, 2008 at 10:16 PM, George Anderson <[EMAIL PROTECTED]> wrote: > David, Aslak, > > Any word on the most eagerly anticipated book ever? Close to beta where: two.weeks < close < three.months I know it's a wide range, but everyone involved is quite busy. Getting closer though. Cheers

Re: [rspec-users] i can haz buk?

2008-04-08 Thread George Anderson
Thx. Remember, when you think "Beta Book," set your expectations low. We're motivated consumers; we'll buy an "Alpha Book." Sorry to distract you from writing. /g On Tue, Apr 8, 2008 at 10:21 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Tue, Apr 8, 2008 at 10:16 PM, George Anderson > <

Re: [rspec-users] i can haz buk?

2008-04-08 Thread Shane Mingins
+1 just ship it ;-) On 9/04/2008, at 2:31 PM, George Anderson wrote: > Thx. Remember, when you think "Beta Book," set your expectations low. > We're motivated consumers; we'll buy an "Alpha Book." > > Sorry to distract you from writing. > > /g > > On Tue, Apr 8, 2008 at 10:21 PM, David Chel

[rspec-users] rspec SQLException problem

2008-04-08 Thread Win Lockwood
hello: I just installed rspec 1.1.3 by doing this: gem install rspec and then in the root of my project, I did this: ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails And now, when I run a unit test (that worked before the rspec installation), I'm getting th

[rspec-users] Testing with has_many associations

2008-04-08 Thread Andy Croll
Hi I'm trying to be good and practice full BDD on my current project, and don't want to abandon it as I have previously (expediency triumphed unfortunately). So expect me to be making frequent 'noob' style posts... My current issue is with testing assignation across a has_many relationship. I'm aw

[rspec-users] What is the best way to verify that yield is called?

2008-04-08 Thread Ben Mabey
Hello all, What is the best way to verify that a method yields a block that is passed in? Before I added any 'yield' to my method I created this spec: it "should yield a message_delivery object" do create_message_in_factory do |message_delivery| message_delivery.should be