similar to: template.expects_render?

Displaying 20 results from an estimated 100 matches similar to: "template.expects_render?"

2007 Nov 09
9
fixture_file_upload and edge rspec?
Hi all, I had some specs that were using fixture_file_upload that were passing just fine. Then I froze edge rails to get some 2.0 functionality, then a I upgraded to trunk rspec to deal with uninitialized constant ActionView::Helpers::JavaScriptMacrosHelper After a couple other of tribulations, I have now gotten down to just a couple of not passing specs, all using the fixture_file_upload.
2007 Jun 19
5
Problems translating should_render from 0.8.2 to 1.0.5
<font size="2">I''m working on a large Rails site and we want to move from RSpec 0.8.2 to the latest and greatest.&nbsp; So we ran the translator and yet we''re having a lot of trouble translating should_render.<br><br>I found this on the web:<br><br>We will NOT be supporting the following in the new syntax:<br>&nbsp;
2006 Nov 21
1
Documentation Nit
I''m trying to wrap my head around rspec_on_rails and ran into the following documentation nit: -------- what it says -------- You can specify :template, :text, or :action. controller.should_render :template=>"path/to/template/for/action" controller.should_render :text=>"expected text" controller.should_render :action=>"expected_action" --------
2007 Apr 09
10
changes in 0.8 and greater - should_
Has the should_... syntax changed? I''m getting errors when running the following: should_render(:index) should_be_valid should_not_be_valid should_respond_to should_be should_render I thought the syntax changed to something like the following: obj.should render(:index) but this doesn''t seem to work. Scott
2007 Aug 01
4
:render expects possible?
Hi, Is it possible to do the following in a controller spec? @controller.should_receive(:render).with(:layout => false) I''ve been trying this kind of thing and it looks like RSpec is messing with the render calls, and requires you to use render_template instead. Could we have at least a warning that mentions that parameters passed to :render expectations are going to be thrown
2007 May 26
11
RSpec
Hi RSpec Mailing list, I''m new to RSpec and I am trying to get it running with the caboo.se sample rails app. I installed the current version of rspec with rspec_on_rails I tried to run rake spec but received: 330-07:~/desktop/restful_auth_rspec/vendor multimedia$ rake spec (in /Users/multimedia/Desktop/restful_auth_rspec)
2007 May 21
4
Just upgraded to 1.0.0, should render_text isn''t working for me
I finally got around to upgrading from 0.8.2 (!!). I had a spec which looked like specify "should render abc123" do controller.should_render :text => "abc123" get :key end With 1.0.0, the new spec is it "should render abc123" do get :key response.should render_text("abc123") end However it doesn''t work, giving me the error: undefined
2006 Nov 07
7
should_redirect_to in advance - feels unnatural
I can understand that it''s easier for rspec to set up a mock in advance of the controller call. But it makes it difficult to do something like: context "The HarkController, given Louie the logged-in user" do setup do post :login, :username => ''louie'', :password => ''atest'' end specify "should redirect Louie to the home
2007 Jul 05
6
mocking methods in the controller.
Hi, I''m very new to rspec so please be patient with me. I''ve tried to take some of my tests out of the controller specs to check for things that are rendered. This has not worked so well, since my views have the controller method current_user in quite a few places. Is there any way that I can define this so that my views will be executed? Will this same thing occur for all
2007 Jun 12
3
rspec 1.0.x and liquid?
Is anyone else using liquid with the > 1 rspec? This seems to fail: it ''should render show'' do 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
2007 Apr 09
7
RCov results seem to include the spec files
I saw the RCov page at http://rspec.rubyforge.org/tools/rcov.html and decided to add it to my project. My rakefile looks like this: require "rake" require "spec/rake/spectask" desc "Run all specs with RCov" Spec::Rake::SpecTask.new("spec:rcov") do |t| t.spec_files = FileList["spec/**/*_spec.rb"] t.rcov = true end When I run rake spec:rcov,
2007 Mar 28
1
extracting common methods out of specs
I have several specs which do more or less the same thing: describe "GET /users/1/terms" do controller_name :terms def do_get get :index, :user_id => 1 end it "should be successful" do controller.should_render :index do_get end ... end How could I extract this functionality from each spec? Scott
2007 Feb 15
4
defining context(s) dynamically
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> Q. Why does code which defines a context work in the
2007 Aug 01
3
Test Rendering nothing in Rails
Hi In a controller I have method that is accessed via an AJAX call and will conditionally do: render :nothing => true to test the condition hitting this line I was hoping to do something like: response.should render_template(:nothing) How should I test this behaviour? Cheers Shane
2007 Aug 13
1
expect_render not?
hi, I have a template that conditionally renders a partial. Is there a way to test that a partial is NOT rendered? :)
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)
2006 Nov 24
13
rSpec on Rails 1.2?
I just updated my Rails install to the most current Edge and my controller specs fail: 1) TypeError in ''The User Controller should be a user controller'' can''t convert nil into String Each spec fails the same way. <context string> <spec string> can''t convert nil into String Any ideas what''s up with this? Thanks, s.ross
2007 Jan 21
35
Collection proxies need to be stubbed ?
Hi all ! I just started writing specs on a new project. I would just like to validate that this is the way you would write it. I know about mocks, stubs and expectations. I don''t think this is a problem for me. My question really boils down to: def index @projects = current_user.projects.active end My spec needs to return the proxy, no ? Here''s my code: context "A
2007 Jan 09
6
rcov seg fault
Hi Trying to get rcov going (has been working), but with the following context and specs it fails. context ''/account POST with invalid attendee'' do controller_name :account setup do Attendee.stub!(:create!).and_raise(ActiveRecord::RecordInvalid.new( Attendee.new)) end specify ''should raise on create'' do Attendee.should_receive(:create!).with({
2007 Feb 02
7
Coming Soon...
Dear spec''ers, As many of you already know, we''re gearing up for a pretty big 0.8 release of RSpec in the next couple of weeks. I''m writing in advance because I want to give you a heads up about upcoming changes and how they may impact your existing specs. Two important things to note first: 1. We will provide a translator that you''ll be able to use to