Displaying 20 results from an estimated 300 matches similar to: "having trouble specing an ajax request"
2007 Jul 28
2
specing a call to render :layout => "some_layout"
I''m trying to specify that an action should be rendered with a given layout
one particular spec.
What I''ve got at the moment is this.
it "should render with the grabber layout" do
controller.should_receive( :render ).with( :layout => "my_layout" )
do_get
end
This doesnt work even though this call to render is being executed.
render :layout
2008 Jan 23
4
expect_render(...).and_return(''x'')
Hi,
I''m trying to spec a controller method which renders some rjs as part
of a render :update block. The problem I''m having is that stub_render
or expect_render don''t seem to allow and_return to work.
The controller method does:
if @thing.save
render :update do |page|
page.insert_html :bottom,
2012 Oct 18
2
help in R
Hello Sir/Madam?
I want to reverse the colour distribution . I want the lowest value of error to be in blue and highest in red .
With Regards?
Namrata Mohapatra
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Rplot.pdf
Type: application/pdf
Size: 214037 bytes
Desc: not available
URL:
2007 Oct 01
15
how to spec views
I''m trying to spec a view but haven''t done much view specing.
This view render different partials depending on authentication of the user:
annon, admin, player
So I I''ll write if conditionals in the view with the partials
it "should render signup propaganda for annon users trying to view games"
do
render "/games/index.rhtml"
2012 Oct 10
1
contour plot help
Hello?
I am interested to plot a contour plot using the colour : rainbow , however I want to reverse the order of the colour ( such that red represents max value and blue min value) and also remove the lines in white in the plot .
?
With Regards
Namrata Mohapatra
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Rplot.pdf
Type: application/pdf
Size: 214037
2007 Aug 13
8
How to use expect_render?
Hi:
I am a rspec beginner. I have scratched my head for the whole afternoon,
trying to figure out a way of writing render expectation in controller spec.
However, I failed. It kept telling me that the ''expect_render'' was an
undefined method. I have installed rspec 1.0.8 and rspec_on_rails as well.
Below is the controller to be tested.
Controller
def index
pre
2008 Mar 03
2
stuck on testing validation
Hello,
I must be doing something dumb, but here it goes...
why does this work?
before(:each) do
@work = Work.new
end
#for testing validates_presence_of :title
it "should require a title" do
@work.title = nil
@work.should_not be_valid
end
while this doesn''t:
def valid_work_attributes
{
:title => "guernica",
:description
2007 Jul 14
3
expect_render twice in views
I found this:
controller.expect_render(:partial => ''thing'', :collection => things).once
but I am trying to expect_render twice in my view spec:
template.expect_render(:partial => ''order_details'').twice
This doesn''t work as the template.expect_render call seems to be
returning an array. Is it possible to expect the rendering of a
partial
2007 Aug 14
12
expect_render, why does there need to be a warning
There is a warning on the web site about expect_render and stub_render:
"WARNING: expect_render and stub_render, while very useful, act
differently from standard Message Expectations (a.k.a. mock
expectations), which would never pass calls through to the real
object. This can be very confusing when there are failures if you''re
not aware of this fact, because some calls will be
2007 Sep 14
5
controller.expect_render has me beat!
Hi,
A controller has a method with the following
def update
...
if @config.update_attributes( params[:new_config] )
redirect_to :action => :index
else
* render :action => :edit, :id => params[:id] # this line here*
end
...
end
The example has the following
it ''should render the "edit" config url on an unsuccessful save''
2008 Mar 12
2
RSpec view test for :partial with :locals?
I''m currently working on some RSpec view tests and I''m having problems
with expect_render. Most of the expect_render''s work fine, but in one
of my views I have:
<%= render :partial => "user_cloud", :locals => {:user =>
@featured_user} %>
I see that expect_render supports ":object" or ":collection" for the
second
2007 Jun 27
3
template.expect_render
Trunksters,
I just added a couple of methods to ActionView::Base in Spec::Rails
(as of r2136) that lets you do this in view examples:
describe ''/things/index.html.erb'' do
it "should render _thing with a collection of things" do
assigns[:things] = things = [Object.new]
template.expect_render(:partial => ''thing'', :collection => things)
2007 Apr 12
3
specing class methods
Here is an example from autotest:
class Autotest
def self.run
new.run
end
def new
...
end
def run
...
end
...
end
How would I spec out Autotest.run?
Two complications come to my mind:
1. How do I spec out class methods? (please point me to docs, if
any. I can only find class level specing on "partial mocks" (of
rails class objects)
2. How can I tell
2007 Sep 04
2
specing helpers fails on restful routes
Hi,
I am trying to spec helper methods in a Rails project, but it seems
the specs fail with the error:
You might have expected an instance of Array.
The error occurred while evaluating nil.<<
if the restful routes helper are used either in spec files, or the helper file.
What can I be doing wrong? Or how can I fix this.
Thanks!
--
Surendra Singhi
http://ssinghi.kreeti.com,
2007 Feb 11
1
Specing Rails Views
Hello -
I''m currently trying to write some specs for my rails views. My
views depend upon
the restful authentication plugin method logged_in? Like so,
<% if logged_in? %>
<ul id="product-admin-nav">
<dd><%= link_to "create a new product", new_product_url %></dd>
</ul>
<% end %>
However, when I have the following
2007 Sep 25
12
Problems with expect_render
Hi there,
I''ve been working with RSpec for about a week now, and the process of
moving from a Test::Unit + Mocha setup to an RSpec + Mocha
environment has been pretty straightforward.
Except, I''m having problems with using template.expect_render.
I have Mocha enabled with:
> config.mock_with :mocha
in spec_helper. And then I have a view spec which looks like this:
2007 Oct 13
1
specing system
Hi!
Having some wine on Saturday and just playing around writing some ruby script:
* have you spec any ''system'' method? As long I know it just returns
false or true and everything else is just out of reach; prove me I''m
wrong :-)
it ''should have response with 64.233.167.99''
system ''ping google.com''
Priit
2007 Dec 22
1
Rails: Specing libraries
I was reading the documentation on using rails with rspec and I didn''t see
anything about how to spec libraries in the rails /lib directory so that
they''re integrated into the whole spec::rails system.
Where should I put specs for my libraries, and what''s the best way to
require the files that I''m testing in my spec?
I''ve never used rspec before, and
2009 Feb 05
1
[rspec] [rails] Specing a form builder
I''m trying to set up and run a new form builder under rails, which lives
under the helpers directory, but isn''t really a helper. (Not a module, so
doesn''t mix in well)
Short of dropping down into a view spec, how do I set up to actually spec
the form builder?
describe RandomFormBuilder do
attr_reader :builder
before do
@object = mock_model(Foo)
@builder =
2007 Sep 08
3
template.expects_render?
Hi All,
I''m trying to make use of template.expects_render, is outlined in
David''s post(http://blog.davidchelimsky.net/articles/2007/06/28/
template-expects_render). I get an undefined method error on
expects_render. I made sure I had the 1.0.8 gem as well as
reinstalling the plugin and redoing the bootstrap. Still no luck. So
I created a clean project, installed the