[rspec-users] Nested Partials

2009-09-02 Thread amkirwan
What is the best way to spec nested partials in rails? Here is the generic type of nesting I am trying to spec. new.html.erb edit.html.erb _outer_partial.html.erb _inner_partial.html.erb ___ rspec-users mailing list rspec-users@rubyforge.org

[rspec-users] stubbing mongoid::criteria in view code

2011-03-24 Thread amkirwan
I'm try to stub the following in my view code but keep running into problems with unexpected messages. I've tried stubbing and mocking in many combinations but can't find away past this. Here is the code below I am trying to spec ... - if page.parent_id.nil? %td - else

Re: [rspec-users] stubbing mongoid::criteria in view code

2011-03-25 Thread amkirwan
no unfortunately that does not work either. I receive the error: undefined method `title' for #___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] stubbing mongoid::criteria in view code

2011-03-29 Thread amkirwan
ment Array > containing the mocked Page) > > > > On Fri, Mar 25, 2011 at 8:18 AM, amkirwan wrote: > > no unfortunately that does not work either. I receive the error: undefined > > method `title' for # > > ___ > >

[rspec-users] Anonymous Subclass of ActionController::Base

2011-03-30 Thread amkirwan
I'm trying to spec a subclass of ActionController::Base using an anonymous subclass but I am running into errors but I am receiving a uninitialized constant StubResource Here is my base class class Admin::BaseController < ApplicationController before_filter :etherweb_site load_and_authorize_

[rspec-users] rspec-rails img src and timestamps

2009-06-04 Thread amkirwan
when I run the following matcher bellow it fails because rails adds the timestamp after the file name. I've looked around but have not found anyone else having this problem. I am new to rails and rspec so maybe I am completely missing something obvious. response.should have_selector("#logo", :src

Re: [rspec-users] rspec-rails img src and timestamps

2009-06-04 Thread amkirwan
I found the answer to my own question. Just needed to use image_path ("logo.jpg"). Incase anyone else has this is I hope this helps. response.should have_selector("#logo", :src => image_path("logo.jpg")) On Jun 4, 9:19 pm, amkirwan wrote: > when I run t

[rspec-users] rspec-rails img src and timestamps

2009-06-04 Thread amkirwan
There is probably an easy solution to this but I am new to rails and rspec and after searching I cannot seem to find an answer. When I try the following code: response.should have_selector("#logo", :src => "/images/logo.jpg") it fails because rails appends a ? and timestamp to the end of the im

[rspec-users] collection-based finder methods

2009-07-21 Thread amkirwan
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 know it is working fine as my cucumber features are passing

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

2009-07-22 Thread amkirwan
) end it "should render show template" do do_get response.should render_template("show") end end On Jul 22, 9:13 am, David Chelimsky wrote: > On Tue, Jul 21, 2009 at 11:21 PM, amkirwan wrote: > > How do I spec this following example from the A

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

2009-07-22 Thread amkirwan
] message.save end I guess I don't understand why assigns[:letter] is expecting a Person instance instead of a Letter instance On Jul 22, 10:42 am, David Chelimsky wrote: > On Wed, Jul 22, 2009 at 9:12 AM, amkirwan wrote: > > My spec is a messed up because I have tried everything I can t

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 somethin

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 > > @

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

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. > > > > > &g

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: >

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

2009-07-22 Thread amkirwan
Person.stub!(:find_by_partners_uid).once.and_return(@user) end That gets me closer I think but I receive a: should assign @user undefined method `find' for true:TrueClass which makes sense, just not sure where to go from here. On Jul 22, 2:33 pm, David Chelimsky wrote: > On Wed, Jul 22, 2009 at 12