search for: render_templ

Displaying 20 results from an estimated 138 matches for "render_templ".

Did you mean: render_temps
2007 May 28
1
Rails matcher render_template is wrong when using GetText, looking for flexible solution
...d be glad for suggestions how to best solve this. When using GetText a failure is reported for the following simplified specification: describe SamplesController, "when requesting /samples" do it "should render index " do get ''index'' response.should render_template("index") end end The result is: SamplesController when requesting /samples - should render index (FAILED - 1) 1) ''SamplesController when requesting /samples should render index'' FAILED expected "index", got "index_en" When I run the applicati...
2010 Nov 16
4
view.should render_template best practices?
...How do we now handle stubbing out rendering of partials in view specs in RSpec2? I have a large (35K+ lines of views and related specs) that I''m trying to upgrade to Rails3/RSpec2. My views use partials pretty extensively and this issue is a huge blocker for me. before do view.should render_template("event_list", :locals => {:calendar => @calendar}) end causes all my related specs fail with: expecting <"event_list"> but rendering with <"">. Expected block to return true value. Any advice?
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 while evaluating nil.first_render /rails/store/trun...
2007 Apr 20
1
getting controller specs to work on edge
...up and working for my controller specs, here''s an example: describe "Requesting /users using GET" do controller_name :users setup do @user = mock_model(User) User.stub!(:find).and_return(@user) end it "should render index.rhtml" do response.should render_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_re...
2010 Jun 20
10
RSpec 2 view example: render_template
On http://github.com/rspec/rspec-rails under "View specs" there''s an example describe "events/index.html.erb" do it "renders _event partial for each event" do assign(:events, [stub_model(Event), stub_model(Event)]) render view.should render_template(:partial => "_event", :count => 2) end end Is this indeed correct? From the outset, it looks wrong because it sets an expectation (view.should ...) after the call to render. Then, no matter if I leave that line where it is or put it before the render, I get an exception un...
2007 May 29
12
questions rspec on rails
Hi, rather than flooding this list with separate emails, I''ve been queueing up questions using rspec with rails. (an irc channel would be nice too :) Here ya go... - Is there a way to test named routes? - Could I get an example how to test an ajax request (link_to_remote)? would that go in view? and/or in controller spec? - Can you assert which layout template is rendered in a
2011 May 28
4
how can I investigate when a rspec test fails?
For example: it "re-renders the ''new'' template" do # Trigger the behavior that occurs when invalid params are submitted Sector.any_instance.stub(:save).and_return(false) post :create, :sector => {} response.should render_template("new") end I have the new template under app/views/sectors but the test says: SectorsController POST create with invalid params re-renders the ''new'' template Failure/Error: response.should render_template("new") expecting <"new">...
2007 Oct 05
2
Rails, rSpec edge problems
Hi, Does the Story Runner work on edge rails? I thought that is what the example app was using but I am on the latest Rails and latest rSpec revisions and I am having problems. When I call ''render_template'' in a story I get the following: NoMethodError: undefined method `render_template'' for #<ActionController::Integration::Session:0x327d974> Do I need to include something or why would this method not be found? The full story is at: http://pastie.caboo.se/104247 Tha...
2007 Jun 19
5
Problems translating should_render from 0.8.2 to 1.0.5
...><br>I found this on the web:<br><br>We will NOT be supporting the following in the new syntax:<br>&nbsp; controller.should_render<br>&nbsp; controller.should_redirect_to<br><br>You will be able to use instead:<br>&nbsp; response.should render_template<br>&nbsp; response.should render_text<br>&nbsp; response.should redirect_to<br><br>But the problem I have is that render_template doesn''t have the functionality that we used in lots of our should_render expectations.&nbsp; A lot of our should renders...
2007 Aug 21
1
Render template not matching absolute path
...do |accepts| accepts.css { render :file => "#{RAILS_ROOT}/app/views/ stylesheets/gap.rcss" } end end end And I want to test that it renders the gap.rcss file, but my spec, it "should render the gap.rcss template" do do_get response.should render_template("gap.rcss") end fails with this error: Expected "gap.rcss", got "/Users/ashleymoran/Documents/Development/ YourMoney/trunk/src/config/../app/views/stylesheets/gap.rcss" I don''t remember this failing in 1.0.5, but it''s been a while since I...
2007 Aug 08
5
Can''t seem to spec a ActiveRecord::RecordInvalid exception properly...
...#39; 9 end I can''t seem to properly spec this out. I am trying numerous things, the latest one is this, which makes sense but it still fails... it "should re-render new on an invalid record exception" do post :create, :user => {:login => nil} response.should render_template(:new) end should re-render new on an invalid record exception expected "new", got nil Any help would be great, thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070808/9cb7bada/attachment...
2011 Jun 09
0
failing integration test
...g/chapters/filling-in-the-layout?version=2.3#code:layout_links_spec Here is my layout_links_spec.rb: require ''spec_helper'' describe "Layout links" do it "should have a Home page at ''/''" do get ''/'' response.should render_template(''pages/home'') end it "should have a Contact page at ''/contact''" do get ''/contact'' response.should render_template(''pages/contact'') end it "should have an About page at ''/about'...
2006 May 23
7
how to pull text from database and eval it?
I''m trying to add some executable code to my blog posts. How can I include this inside of a blog post and eval it? Charlie bowman http://www.recentrambles.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060523/a3536408/attachment.html
2006 Apr 22
5
selenium plugin not working with rails 1.1
Hi, I really like selenium, and I just tried the plugin created Jonas Bengtsson. However I cannot get it to run on rails 1.1 and coundn''t find anyone complaining about it? Did anyone get it to run on rails 1.1.2? Greets, Abdur-Rahman
2006 May 26
8
calling render_to_string outside of controller
How can I call render_to_string outside of a controller. I''m stuck on this. I''ve nearly got my plugin finished but I can''t seem to get this to work. The method is in ActionController::Base but it is protected. -- Posted via http://www.ruby-forum.com/.
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 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 away and mention an alternative way of spec-ing this behaviour? Thanks, Edward
2005 Oct 14
2
Capture template output as plain html?
Hi, I''m trying to find out if the following is possible. I have a rhtml template stored in the database as a string. I need to process the template (as a string), similar to using ActionView''s <%= render_template("rhtml", @template_string) %>, but I need to do this in the ActionController and capture the result as a string. There is a method "render_to_string" in ActionController, however I don''t see that there is a way to pass it the template as a string. Basicall...
2007 May 23
2
rspec mocha and controller specs without integrated_views
...#39;' as the following code below shows you, the mocking of views is rspec specific. 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 generate...
2008 Jan 31
4
RSpec-1.1.3
...story listeners. Closes #253. * Fixed bug where the wrong named error was not always caught by "should raise_error" * Applied patch from Luis Lavena: No coloured output on Windows due missing RUBYOPT. Closes #244. * Applied patch from Craig Demyanovich to add support for "should_not render_template" to rspec_on_rails. Closes #241. * Added --pattern (-p for short) option to control what files get loaded. Defaults to ''**/*_spec.rb'' * Exit with non-0 exit code if examples *or tests* (in test/unit interop mode) fail. Closes #203. * Moved at_exit hook to a method in Spec:...