search for: egervari

Displaying 8 results from an estimated 8 matches for "egervari".

2011 May 27
14
[rails] undefined method `model_name' for NilClass:Class
Never seen the error above before, code: describe "edit action" do it "edit action should render edit template" do food = Food.create(:name=>''mooo'') # Food.any_instance.stubs(:valid?).returns(true) get :edit, :id => food.id response.should render_template(:edit) end end -------------- next part
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
2011 Apr 13
3
Question about ERB performance
I''m trying out rails 3 and I''m looking at the performance statistics given by WEBrick. It says many of my database operations are taking 2ms or 7ms... but the view is taking 40ms. People often say that the database is the bottleneck in applications (which it most certainly can be, and often is)... but isn''t the rendering of ERB a little show here? My test pages really
2011 May 26
8
Is there a way I can create a sub-layout with ERB?
I have 2 pages that have almost the same content except for stuff in the middle. I''d basically like to have a sub-layout that wraps the content that is different - exactly the way a normal layout file would. How can I call into a layout inside of erb? I''d like to do something like this: <%= render :sub-layout => "reusable-wrapper" %>
2011 May 21
2
How do you create a sub-layout or a partial that wraps a lot of custom html?
Basically I''d like to create a layout inside of a layout using erb. Something like this: <%= render :partial => ''support'' do %> <div id="helpDocumentView"> <h3><%= @help_document.question %></h3> <%= @help_document.content %> <div id="helpDocumentHelpful" data-help-document-id="<%=
2011 May 31
0
How do you test a module that extends ActiveSupport::Concern?
I have a module that extends ActiveSupport::Concern. Here is the `included` block: included do after_save :save_tags has_many :taggings, :as => :taggable has_many :tags, :through => :taggings end How can I stub out these calls? I have tried a few ways, but Ruby complains that these methods don''t exist when I try and test the module in isolation. Thanks!
2011 May 22
1
How do you crop an image with carrierwave 'after the fact' in rails?
What I''d like to do is upload an image, then take the user to a new page where I will use Jcrop to let the user select the part of the image they want to crop, and then store that image. Essentially, I want to make it a 2-stage process. I know how to do the javascript part, and I understand the basic flow of how to create this functionality. However, I am not aware of the carrierwave
2024 Mar 04
2
Almost all print driver uploads fail
Hi, I'm working on a minimal print server setup for Windows 10/11 x64 clients. No domain, no Kerberos, no LDAP, only a few local users on a standalone server with some shared CUPS printers. Printing works well. After setting 'spoolss: os_major = 6' and 'spoolss: os_minor = 1' The *Kyocera KX Universal Driver* has uploaded well. But, that's all. No success uploading