Displaying 7 results from an estimated 7 matches for "first_render".
2007 Jun 12
3
rspec 1.0.x and liquid?
...response.should render_template(''buyers/show'')
get :show, :id => 1
end
with an error like
1)
NoMethodError in ''/buyer GET should render show''
You have a nil object when you didn''t expect it!
The error occurred while evaluating nil.first_render
/rails/store/trunk/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/render_template.rb:12:in
`matches?''
spec/controllers/buyer_controller_spec.rb:57:
spec/controllers/buyer_controller_spec.rb:63:
should render_template is looking for
11: def matches?(response)
12: @ac...
2007 May 23
2
rspec mocha and controller specs without integrated_views
...ecific. See stub!
versus mocha''s stub
unless block_given?
unless integrate_views?
@template.stub!(:file_exists?).and_return(true)
@template.should_receive(:render_template).any_number_of_times.and_return(true)
{ |*args|
@first_render ||= args[2]
}
@template.stub!(:find_template_extension_for).and_return("rhtml")
@template.stub!(:read_template_file).and_return("this is fake
content generated by rspec")
end
end
I am getting the following error:...
2005 Dec 19
1
Preserving fallback with RJS
...elsif javascript_template_exists?(template_path): ''rjs''
else
raise ActionViewError, "No rhtml, rxml, rjs or delegate
template found for #{template_path}"
end
end
def render_file(template_path, use_full_path = true, local_assigns = {})
@first_render = template_path if @first_render.nil?
if use_full_path
template_extension = pick_template_extension(template_path)
template_file_name = full_template_path(template_path,
template_extension)
else
template_file_name = template_path
template_extension...
2007 Apr 20
1
getting controller specs to work on edge
...er_template(''index'')
do_get
end
end
When I run that via rake spec:controllers I get:
NoMethodError in ''Requesting /users using GET should render index.rhtml''
You have a nil object when you didn''t expect it!
The error occurred while evaluating nil.first_render
.../vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/render_template.rb:12:in
`matches?''
Originally, after the translator, the "it" section was:
it "should render index.rhtml" do
controller.should render_template(''index'')
do_get
end...
2006 May 04
1
How do I identify the initiating View from within a Helper?
I would like to call a helper method from my View to construct a sidebar
menu. The menu is contextual, so ideally I would like to do something
like this:
View
----
<%= sidebar_menu %>
Helper
------
def sidebar_menu
case _calling_view_
when ''_view_identifier_''
... build menu...
end
end
where ''_calling_view_'' is the key that points to the
2006 May 04
1
Re: How do I identify the initiating View from within aHelper?
...t; sidebar_menu(''search_screen'')), but I consider this redundant.
>
> Is this possile? Is there a better approach?
The action name is available as "action_name".
As for the view name, all I can see after a quick look through
the Rails code is the variable "@first_render". It''ll work,
but is undocumented, and so is not guaranteed to work in future
versions.
--
We develop, watch us RoR, in numbers too big to ignore.
_______________________________________________
Rails mailing list
Rails@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/...
2006 Jun 16
0
rake spec controller test output hideus.
...ntent_type=nil,
@request_parameters={:user=>{:password=>"newpassword",
:login=>"newbob", :email=>"newbob@mcbob.com",
:password_confirmation=>"wrong"}, "action"=>"signup",
"controller"=>"user"}>, @first_render="user/signup",
@url=#<ActionController::UrlRewriter:0x24d4ea4
@parameters={"user"=>{"password_confirmation"=>"wrong",
"login"=>"newbob", "password"=>"newpassword",
"email"=>"newbob@mcbob...