similar to: rspec-rails and rack middleware

Displaying 20 results from an estimated 300 matches similar to: "rspec-rails and rack middleware"

2009 Feb 06
6
RecordNotFound bubbling thru to cucumber
Hello, I have a controller action that raises a RecordNotFound exception if you''re not allowed to see something. In my global application controller (application.rb), I catch these and render the 404 template. But when I run cucumber (using webrat), it''s getting the full stacktrace (the step blows up). Any ideas why? I have consider_all_requests_local turned off in my test.rb.
2009 Sep 30
10
Can't run specs after upgrading gems... get 0 tests, 0 assertions...
So after I updated all my gems, I started getting: /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/ dependencies.rb:105:in `const_missing'': uninitialized constant Test::Unit::TestResult::TestResultFailureSupport (NameError) from /Library/Ruby/Gems/1.8/gems/test-unit-2.0.3/lib/test/unit/ testresult.rb:28 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
2008 Nov 06
3
Verifying some understanding about manipulating DB data in before/after callbacks in RSpec
We had an after(:each) callback that looked like this: PurchaseOrder.find(:all).each {|po| DraftInvoice.find_all_by_po_number(po.po_number).each {|di| di.destroy}} which we were hoping would reset some purchase order data in a certain way. However, because we have "self.use_transactional_fixtures = true" set in test_helper.rb, this code was never getting committed. So, I just
2009 Oct 14
14
spec-ing private methods?
On Wed, Oct 14, 2009 at 5:49 PM, Scott Taylor <scott at railsnewbie.com> wrote: > > On Oct 14, 2009, at 3:36 PM, Joaquin Rivera Padron wrote: > > hello there, > how do you tipically spec private methods? The thing is ? have something > like this: > > def some_method > ?? complex_method + other_complex_methods > end > > private > def complex_method...
2009 Jul 21
1
[RAILS] - 2.3.3 creating a sea of red
hello, I''ve already asked via Rails channels on this and have received no response, so I''m asking here in hopes someone has run into something similar. I updated to rails 2.3.3 yesterday, and now all of my specs are failing with the following error: Fixture::FormatError in ''PublishedGallery Methods#thumbnail should delegate to its lead asset'' a YAML error
2009 Sep 20
11
describe block proc parameter as alternative to before blocks?
I''ve been reading through the Rspec book to see if I missed any tricks, and the discussion of before block use for context setup in sec 12.6 struck me as interesting and something I had a knee-jerk reaction to. I think that when you are using nested examples to describe a context change it is bad practice to allow any example within that group to run outside of that context. This could
2009 Oct 06
3
rspec-rails 1.2.9 Released
rspec-rails version 1.2.9 has been released! * <http://rspec.info> * <http://rubyforge.org/projects/rspec> * <http://github.com/dchelimsky/rspec-rails> * <http://wiki.github.com/dchelimsky/rspec/rails> * <rspec-devel at rubyforge.org> Behaviour Driven Development for Ruby on Rails. Changes: ### Version 1.2.9 / 2009-10-05 * enhancements * added route_to and
2009 Oct 20
8
Stub that returns hash values
Is it possible to create a stub that returns hash values. For example I would like to convert this: @siteItem = stub(''plmSiteItem'', :one => "uno") To something like this: @siteItem = stub(''plmSiteItem'', {''one'' => ''uno'', ''two'' => ''dos''} ) So that I can do this:
2004 Oct 21
3
Ucarp and shorewall
Has anyone successfully setup a shorewall Ucarp solution?
2013 Apr 02
10
Suggested strategies for testing a gem against Rails 3.x and Rails 4?
I''ve seen a few examples of dummy Rails apps (for testing, so they live under test or spec dirs, typically) for use with the Appraisals gem that supposedly work with both Rails 3.x and Rails 4, but they seem hackish and not fully functional. It is somewhat expected, as it is a stripped down Frankenstein monster that is trying to be compatible with various versions of Rails 3 as well
2013 Jul 22
0
How to handle exception that is generated in rack middleware before it reach rails app?
I know that we can use config.exception_app to set up custom exception handling and also use rescue_from. However, I have an issue that there is malformed request (testing generated request) that caused Rails Rack middleware to throw an exception when Rack''s parse_query method. Here is the detail of the problem:
2014 Mar 27
0
Rack middleware for shared connection pools?
I have a Rails app that makes connections to other DBs. There may be multiple users connecting to multiple DBs. The app makes a database connection as part of an action. However, I noticed a problem: there's too many DB connections remaining open, which is causing the DB to not have enough connections remaining for new connections. So the answer is using a shared connection pool.
2012 May 31
1
Rack Middleware or after filter
Hi All I need an solution that i should catch response and based on some conditions i have to modify response body and send back to client. I have tried with a Middleware and got a solution.Can i use a Middleware or simply one after_filter. On performance wise which is best.Or is there any other ways to do it. thanks in advance. -- You received this
2011 Jun 03
0
Rack Middleware support for Rails 2.0.2? If not what is the alternative to implement similar functionality in Rails 2.0.2..
Hello all, I am using Rails 2.0.2 and Ruby 1.8.7 and I need to make use of rack middleware for integrating an ajax file upload plugin(https:// github.com/valums/file-uploader) with paperclip in Rails( As given in this tutorial:- http://mooooooooooo.wordpress.com/2010/12/03/paperclip-valums%E2%80%99s-file-uploader-and-middleware-continued/). I have referred to the rack-middleware Railscast by
2007 Jul 09
10
Having problems with rake?
I am a total newbie to Rails and Ruby. I have the Agile Web Development with Rails book and am following through the first few chapters. I got to the "Creating you own Rails API Documentation" and followed the following steps. rails dummy_app cd dummy_app Then when I run the "rake rails:freeze:gems" command I get the following error. No rails gem 3.0.5.001 is installed. Do
2006 Jun 12
2
Database in RoR application
I''m working on a new rails project that will have a very, very large database. Initial insert will be in the hundreds of thousands of records. The database we are getting the information from is Microsoft SQL based, and we have access to tab delimited update files daily. We''re trying to write import scripts and use a well designed database on our end. The data they are
2008 Aug 11
1
Confused about square bracket usage.
I ran script/generate rspec_scaffold page title:string body:text and have been reading on the generated code in my spare time in an attempt to fully understand rspec. It mostly makes a lot of sense except for the square brackets in the snippet below. To my best understanding, [mock_page] would be an array containing mock_page. That almost makes sense, buy why wouldn''t the variable
2008 Aug 05
1
Rails controller specs and private helper methods
Hello guys, Been a while since last time I worked with Rails so is taking me a while get back to full speed. For a specific scenario I''m facing right now, I required to implement a generic REST controller that accept any kind of resource and provide a @collection or @record to work with. I take from the route requirements the name of the resource
2008 Jul 05
5
Does RSpec work nicely with UUID primary keys?
I have my application happily generating UUID primary keys using the uuidtools gem. But the auto-generated specifications created by "script/generate rspec_scaffold...", etc, assume that one is using a sequential integer primary key. For those who have hit this same issue, is it just a matter of rewriting the auto-generated specifications to take this into account, or does one have to
2015 Feb 20
0
Install problems (group permissions) with nut 2.7.2 [driver selection and starting]
On Feb 19, 2015, at 11:23 PM, Gene Heskett <gheskett at wdtv.com> wrote: > Almost $800 dollars and worthless > on wheezy. I am asking a few ?? over that on their mailing list as it > worked perfectly on ubuntu-10.04.4 LTS. If you still have a backup of /etc from the Ubuntu install, there might be some clues in /etc/cups about the duplex settings (or which drivers support duplex,