similar to: How to use request helpers outside of controller specs?

Displaying 20 results from an estimated 300 matches similar to: "How to use request helpers outside of controller specs?"

2010 Sep 30
5
response.should have_text leads to undefined method `has_text?'
One of my controllers directly renders some JSON output that I would like to test with RSpec. For that I use ''response.should have_text("foobar")'' in my spec file, but that leads to a Failure/Error: response.should have_text("enim") undefined method `has_text?'' for #<ActionController::TestResponse: 0xb6736944> I read here somewhere that webrat
2017 Nov 01
1
Creating Tag
i want to tag categories to its menuname. i have a csv containing menu item name and in other csv i have a column containing some strings, i want to pick that strings from categories and look into menu items if any menu item containing that string i want to create a new column next to menu item name flagged as 1 otherwise 0 and the only condition is once a menu item flagged as 1 i don't need
2010 Dec 15
2
Error reverse engineering MySQL with RMRE
Hi I am been trying in vain to auto-gen models by reverse-engineering mysql using RMRE. It complains mysql2 gem missing but as seen in my Rails environment below, it is there. Here''s my Rails environment and RMRE error. Experts... please help! Thanks a ton in advance!! === Ruby version 1.9.2 (x86_64-linux) RubyGems version 1.3.7 Rack version 1.2 Rails version 3.0.3 Active Record
2007 Jun 19
5
TentSteak 0.2.0
The second release of TentSteak is out and available as a gem on rubyforge ("gem install tent_steak"). This version introduces a handful of new form helpers, a couple method renames, editable HTML tables, and some application bootstrappers for kickstarting Camping and initializing ActiveRecord. It''s still in active development, and I''d very much appreciate
2013 Mar 26
2
Using rack.hijack with ActionController::Live
Pinging @tenderlove Some questions on how best to move forward with this: 1.) AC::Live is making use of the stream object on ActionDispatch::Response. Should the rack.hijack_io object be used instead of this in AC::Live or should ActionDispatch::Response be changed to use rack.hijack_io? 2.) What do you think about changing AC::Live to work with adapters? I suspect the primary use case for
2010 Nov 19
1
Help: delegated association 'App' returning ActionDispatch::Integration::Session instead
class Foo < ActiveRecord::Base has_one :bar delegate :app, :to => :bar end class Bar < ActiveRecord::Base belongs_to :app def self.attribute_column_names return @@attr_columns if defined?(@@attr_columns) readers = content_columns.map { |n| n.name.intern } - [:created_at,:updated_at] @@attr_columns ||= readers.map { |k| [k, "#{k}=".to_sym] }.flatten end
2011 Jul 31
2
Looks like an error in docs for ActionDispatch::Routing::Mapper::Resources
Please take a look at this page: http://api.rubyonrails.org/classes/ActionDispatch/Routing/Mapper/Resources.html#method-i-resource It reads: :path Set a path prefix for this resource. resources :posts, :path => "admin" All actions for this resource will now be at /admin/posts. For me (Rails 3.0.9) it routes to just "/admin", not "/admin/posts".
2004 Feb 24
2
Samba Slow, and I have high Quality NICS
I have SLOW file transfers across samba to my Windows Server 2000 domain. I am using a built in 100bT Intel Pro NIC, I have tried the built in gigabit NIC and a PCI 3com, all with the same results. Using iperf, I get about 45-90Mb of bandwidth from my PC's to my samba server. I can pull it up by \\servername <file:///\\servername> or \\ipaddress <file:///\\ipaddress> with out
2012 Jul 23
4
uninitialized constant ActionController::Flash::FlashHash [NameError])
My application, a very simple general ledger, that worked very well until June 26 does not work any longer. It is used under Ubuntu 12.04 and I believe there was a Ruby update after that. What happens? When I try to start the appIication I get the following output in my web browser: ActionDispatch::Session::SessionRestoreError Session contains objects whose class definition isn''t
2007 May 18
2
TentSteak First Release
Hey all, I just pushed out the inaugural release of TentSteak 0.1.0, a set of Camping/Markaby helpers to minimize the busywork in your views (or was that the "viewwork in your busies"?). It includes lotsa HTML form and table helpers, plus a little bootstrapper to make it easy to load in shared helper modules of your own. Please check it out and let me know what you think.
2011 Mar 11
12
A file-upload suddenly seems to be nil
Hi there, I posted this issue <https://groups.google.com/forum/?hl=de#!topic/carrierwave/ergk9LaO68k>at the carrierwave-group, but I''m beginning to think this rather is a rails-issue than a problem with carrierwave. The problem''s this: I have 2 models, ''article'' and ''upload''. article has_many :uploads. In my article_controller i
2011 Aug 07
9
How can I disable Rails 3.1's ActiveRecord Query Caching?
Hey guys, As most of you know, Rails 3.1 introduces query caching for ActiveRecord. Great change all-in-all, but for those of us with IT department mandates for using MySQL (yeah, yeah, I know...), it''s kind of a mixed bag. I need to disable query caching in a project I''m building based on 3.1. I''ve tried a couple different approaches, both without any success. I
2010 Jun 04
8
unicorn_rails cleanup (possible fix for Rails3) pushed
Hi all, I''ve pushed the following patch out go git://git.bogomips.org/unicorn along with a few other Rails-related test updates. This is more of a shotgun fix (but less code is better :) since I haven''t been able to reproduce the brokeness people have been seeing with "unicorn_rails" and Rails 3 betas. Even though "unicorn" works perfectly well for Rails3,
2010 Feb 09
4
Rails3 pre and protect_from_forgery
I''ve almost entirely converted a rails 2.3.5 app to 3pre. I''m having some trouble with protect_from_forgery. I had protect_from_forgery set in application_controller.rb, but run some uploadify ajax stuff in one of my controllers, where I had protect_from_forgery, :except => :add_file set. In rails 3 I''m getting ActionController::InvalidAuthenticityToken on the ajax
2011 Feb 08
1
Why use DatabaseCleaner with rSpec?
Hi list, I''ve used DatabaseCleaner in the past, but only when using Cucumber and Selenium (or Steak + Celerity) since turning on transactional_fixtures would prevent the data being accessible from app-server that is also triggered for the tests. This works fine, and is a de-facto solution for this problem. I don''t see why I would want to use DatabaseCleaner with rspec though,
2010 Sep 21
7
Ajax CSRF in Rails3
I''m using rails3. It does not seem to check the authenticity_token when doing a POST using Ajax. I traced this to: module ActionDispatch class Request < Rack::Request ..... def forgery_whitelisted? get? || xhr? || content_mime_type.nil? || ! content_mime_type.verify_request? end end so you don''t check if its a get? or a xhr? (ie ajax request). Is this correct? --
2005 May 21
2
Possible (ab)use of lexical scoping in R ?
Dear list, I wish to define a set of functions *auxilliary* to another set of "main" ones, and I wonder if there is some "clever" way do do this using lexical scoping. Looking for that in the list's archives did not get me easily understood answers. Perusing MASS (1st, 2nd, 3rd and 4th editions!) and "Programming S" wasn't of much help either... R easily
2011 May 16
2
Cannot get multipart => true , running well in my form when using remote => true
I have a simple form , with a file field = form_for (Clip.new), :html => {:multipart => true} , :remote => true , do |f| = f.hidden_field :user_id, {:value => current_user.id} = f.text_field :name = f.text_area :description = f.file_field :image = f.submit I18n.t(:add) generating the html code <form accept-charset="UTF-8"
2013 Jun 22
4
ActiveRecord::Base.transaction - SystemStackError - stack level too deep:
Im having an issue that seems to only happen when trying to use a transaction. Ive used transactions many times in the past and Im at a loss as to why im getting the stack level too deep problem. SystemStackError - stack level too deep: actionpack (3.2.13) lib/action_dispatch/middleware/reloader.rb:70:in `'' I have a StackOveflow with more detail -
2011 Aug 31
5
3.1rc8 - posting files in a test no longer works
A previously working test, that posted a file object no longer works in the latest 3.1. The test looks like this: params[:media][:new_attachment] = File.open("#{Rails.root}/test/data/ less_than_100.png") post :create, params In the controller, I obviously expect params[:media][:new_attachment] to be a File object - and it used to be. Now it looks like #inspect has been called on the