Re: [rspec-users] Spec::Mocks::MockExpectationError

2010-11-24 Thread Arun Sharma
thanks for reply my other methods in spec file it is working properly(index,edit,update...) but here it creates a probelm.bascially except CRUD opertion it is not working. get :automatic_partitions,{:harddrive_id=>'sda',:server_id=>1938} assigns[:prev_values].should=='' i simply want

[rspec-users] Question: Define custom matcher like raise_error, by Matchers.define

2010-11-24 Thread 白井 薫
I have a question about the custom matcher using Matcher#define. My intention is given by the following code: Spec::Matchers.define :be_done do match do |block| block.call true end failure_message_for_should

Re: [rspec-users] How to mock a logged in user

2010-11-24 Thread Raghu Somaraju
Robert Dober wrote: > > On Tue, Nov 23, 2010 at 1:04 PM, Raghu Somaraju > wrote: >> >> Thank you Robert. That works. I should have used the "current_user" >> instead >> of @_current_user in the first place. >> >> But, if I do want to use @_current_user, how do I pass on that instance >> variabl

Re: [rspec-users] Specs for controllers and rescue_from

2010-11-24 Thread Nick
On Nov 21, 5:02 pm, David Chelimsky wrote: > http://relishapp.com/rspec/rspec-rails/v/2-1/dir/controller-specs/ano... Fantastic. Thanks, David! ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Puzzled about the rspec tests generated by Rails3

2010-11-24 Thread David Chelimsky
On Nov 24, 2010, at 3:39 PM, Robert Dober wrote: > Hi all > > I am puzzled about the rspec tests that are generated by Rails3 > scaffolding. I am however not sure if this is the correct place to > discuss this issue. > It might be that a rails ML/chat is better suited for that kind of > discussio

[rspec-users] Puzzled about the rspec tests generated by Rails3

2010-11-24 Thread Robert Dober
Hi all I am puzzled about the rspec tests that are generated by Rails3 scaffolding. I am however not sure if this is the correct place to discuss this issue. It might be that a rails ML/chat is better suited for that kind of discussion. It just depends on who is responsible for that code. Somehow

Re: [rspec-users] NestedIterator Assistance

2010-11-24 Thread Andrew Davis
Oops, it appears I've posted this in the wrong forum. I apologize. -- 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] stub_chain together with should_receive

2010-11-24 Thread David Chelimsky
On Nov 23, 2010, at 7:12 PM, medihack wrote: > Hello. > > I am trying to test if in a method calling chain one of the methods > get a specific parameter. In the below code for example MyModel must > receive the parameter 0 for the method "offset". Unfortunately the > code below does not work. It

Re: [rspec-users] Spec::Mocks::MockExpectationError

2010-11-24 Thread David Chelimsky
On Nov 24, 2010, at 1:07 AM, Arun Sharma wrote: > hii > > I am initial level of rspec. I am getting a error nil class. > > My Controller code is as follows > > class UsersController < ApplicationController > before_filter :have_hard_drive? > # # filter check for authorized user to access cur

[rspec-users] NestedIterator Assistance

2010-11-24 Thread Andrew Davis
Hello everyone, Metric_fu is informing me of some nested iterators, and I was hoping to gather some advice on how to refactor this method to make it more correct. Hopefully this will assist me in refactoring many other methods! Code is here: http://pastie.org/private/kqp1kk2uk81rs8s6atag Any tho