Re: [rspec-users] Unsubscribing from the list ...

2009-07-22 Thread Bryan Ray
Yes. Sorry ... should have been more specific. It says a "confirmation email" has been sent out, but I never receive it (i've checked spam, filters, etc) ... just never shows up. On Wed, Jul 22, 2009 at 4:36 PM, David Chelimsky wrote: > On Wed, Jul 22, 2009 at 4:13 PM, Bryan Ray wrote: > > I'm cu

Re: [rspec-users] Unsubscribing from the list ...

2009-07-22 Thread David Chelimsky
On Wed, Jul 22, 2009 at 4:13 PM, Bryan Ray wrote: > I'm currently subscribed to this list on two email addresses (personal and > 'work') ... i would like to remove this list from my 'personal' just to > reduce the amount of email ... > I have tried using the unsubscribe feature on the web site Whe

[rspec-users] Unsubscribing from the list ...

2009-07-22 Thread Bryan Ray
I'm currently subscribed to this list on two email addresses (personal and 'work') ... i would like to remove this list from my 'personal' just to reduce the amount of email ... I have tried using the unsubscribe feature on the web site as well as attempting to send an email with "unsubscribe" but

Re: [rspec-users] collection-based finder methods

2009-07-22 Thread amkirwan
the find_by_partners_uid is in the ApplicationController before_filter which handles setting the @user via RubyCAS I removed some of the duplication since posting. Just some left over code from when I was trying everything earlier to get this to pass. I thought it would be easy but didn't realize

Re: [rspec-users] collection-based finder methods

2009-07-22 Thread David Chelimsky
On Wed, Jul 22, 2009 at 12:33 PM, amkirwan wrote: > sorry here it is > http://gist.github.com/152123 I see find_by_partners_uid referenced in the login_and_before_filter_pass macro and again in before(:each) - so there is likely some conflict there. Also, I don't see where find_by_partners_uid is

Re: [rspec-users] collection-based finder methods

2009-07-22 Thread amkirwan
I have also posted the original passing spec and controller before I tried to change the find to @user.letters.find(id) http://gist.github.com/152175 On Jul 22, 1:33 pm, amkirwan wrote: > sorry here it ishttp://gist.github.com/152123 > > On Jul 22, 1:02 pm, David Chelimsky wrote: > > > > > On W

Re: [rspec-users] collection-based finder methods

2009-07-22 Thread amkirwan
sorry here it is http://gist.github.com/152123 On Jul 22, 1:02 pm, David Chelimsky wrote: > On Wed, Jul 22, 2009 at 11:38 AM, amkirwan wrote: > > Here is the code, > > Where? I don't see code pasted or a link to a gist. > > > > > > > I pasted the letter_controller.rb, > > letters_controller_spec.

Re: [rspec-users] Making sure a action exists (aka specing a controller action)

2009-07-22 Thread David Chelimsky
On Wed, Jul 22, 2009 at 11:19 AM, Marcelo de Moraes Serpa wrote: > Hello list! > > In my efforts of following BDD in a disciplined manner, I found myself > needing to spec a Rails action. > > The behavior I wanted to test was: "This controller should handle the > index action", and since it is not

Re: [rspec-users] collection-based finder methods

2009-07-22 Thread David Chelimsky
On Wed, Jul 22, 2009 at 11:38 AM, amkirwan wrote: > Here is the code, Where? I don't see code pasted or a link to a gist. > I pasted the letter_controller.rb, > letters_controller_spec.rb and the controllers macros.rb, thanks again > for your help. > > On Jul 22, 12:11 pm, David Chelimsky wrote:

Re: [rspec-users] collection-based finder methods

2009-07-22 Thread amkirwan
Here is the code, I pasted the letter_controller.rb, letters_controller_spec.rb and the controllers macros.rb, thanks again for your help. On Jul 22, 12:11 pm, David Chelimsky wrote: > On Wed, Jul 22, 2009 at 10:52 AM, amkirwan wrote: > > Okay I get the "and_return" part now thanks. > > > Here is

[rspec-users] Making sure a action exists (aka specing a controller action)

2009-07-22 Thread Marcelo de Moraes Serpa
Hello list! In my efforts of following BDD in a disciplined manner, I found myself needing to spec a Rails action. The behavior I wanted to test was: "This controller should handle the index action", and since it is not good practice to go to the implementation before specing, I decided to spec t

Re: [rspec-users] collection-based finder methods

2009-07-22 Thread David Chelimsky
On Wed, Jul 22, 2009 at 10:52 AM, amkirwan wrote: > Okay I get the "and_return" part now thanks. > > Here is the error > > http://gist.github.com/152061 Well, the error seems quite clear. It's expecting a Letter and gets a Person. I know you've posted bits of the code in this thread, but would yo

Re: [rspec-users] collection-based finder methods

2009-07-22 Thread amkirwan
Okay I get the "and_return" part now thanks. Here is the error http://gist.github.com/152061 On Jul 22, 11:39 am, David Chelimsky wrote: > On Wed, Jul 22, 2009 at 10:31 AM, amkirwan wrote: > > Thanks for the help but I guess I am not getting something. How is > > @user= = mock_model(Person) and

Re: [rspec-users] collection-based finder methods

2009-07-22 Thread amkirwan
thanks, I understand now the ".and_return" part. Here is the failure I am receiving http://gist.github.com/152061 On Jul 22, 11:39 am, David Chelimsky wrote: > On Wed, Jul 22, 2009 at 10:31 AM, amkirwan wrote: > > Thanks for the help but I guess I am not getting something. How is > > @user= = m

Re: [rspec-users] collection-based finder methods

2009-07-22 Thread David Chelimsky
On Wed, Jul 22, 2009 at 10:31 AM, amkirwan wrote: > Thanks for the help but I guess I am not getting something. How is > @user= = mock_model(Person) and different then the following code: This is assigning the mock_model(Person) to a @user instance variable in the spec. This is not the same user t

Re: [rspec-users] collection-based finder methods

2009-07-22 Thread amkirwan
Thanks for the help but I guess I am not getting something. How is @user= = mock_model(Person) and different then the following code: message = mock_model(Message) Message.stub!(:new).and_return message message.should_receive(:save) post :create def create message = Message.new params[:new] mess

Re: [rspec-users] collection-based finder methods

2009-07-22 Thread David Chelimsky
On Wed, Jul 22, 2009 at 9:12 AM, amkirwan wrote: > My spec is a messed up because I have tried everything I can think of > to mock but this is what I have for the show method. The @user > instance is setup in the login_and_before_filter_pass macros with the > following: @user = mock_model(Person, :

Re: [rspec-users] collection-based finder methods

2009-07-22 Thread amkirwan
My spec is a messed up because I have tried everything I can think of to mock but this is what I have for the show method. The @user instance is setup in the login_and_before_filter_pass macros with the following: @user = mock_model(Person, :null_object => true) The error I keep receiving is that

Re: [rspec-users] Loading (or stubbing) data before model loading

2009-07-22 Thread David Chelimsky
On Wed, Jul 22, 2009 at 8:27 AM, Tom Stuart wrote: > On 22 Jul 2009, at 13:57, David Chelimsky wrote: >>> >>> The problem is that RSpec starts with an empty test database >> >> Not exactly. RSpec starts with whatever database you have and rolls >> back to that state after each example provided you'

Re: [rspec-users] Loading (or stubbing) data before model loading

2009-07-22 Thread Tom Stuart
On 22 Jul 2009, at 13:57, David Chelimsky wrote: The problem is that RSpec starts with an empty test database Not exactly. RSpec starts with whatever database you have and rolls back to that state after each example provided you're only using before(:each) to set up state before each example.

Re: [rspec-users] collection-based finder methods

2009-07-22 Thread David Chelimsky
On Tue, Jul 21, 2009 at 11:21 PM, amkirwan wrote: > How do I spec this following example from the Agile Rails Book listed > below. I am doing a similar thing in my controller and when I > attempted to change it to the collection way of doing the find I am > unable to get my spec to pass though I kn

Re: [rspec-users] Loading (or stubbing) data before model loading

2009-07-22 Thread David Chelimsky
On Tue, Jul 21, 2009 at 2:58 PM, Tom Stuart wrote: > Hi, > > A Rails project I'm working on has, for better or worse, some data-driven > structure in its models: a few model classes need certain values (e.g. some > enumerations) to be available in the database at load time in order for > certain bi

Re: [rspec-users] Loading (or stubbing) data before model loading

2009-07-22 Thread Matt Wynne
On 21 Jul 2009, at 20:58, Tom Stuart wrote: Hi, A Rails project I'm working on has, for better or worse, some data- driven structure in its models: a few model classes need certain values (e.g. some enumerations) to be available in the database at load time in order for certain bits of me

Re: [rspec-users] how i can spec session variable in controller spec?

2009-07-22 Thread Matt Wynne
On 22 Jul 2009, at 07:36, Dhwani Panchal wrote: Hello There, Can i spec session variable in my controller spec? Yes: http://rspec.info/rails/writing/controllers.html cheers, Matt Wynne http://mattwynne.net +447974 430184 ___ rspec-users mailing