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
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
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
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 #
> > ___
> >
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_
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
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
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
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
)
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
]
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
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
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
> > @
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
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
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:
>
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
17 matches
Mail list logo