similar to: RSpec Routing Error: Expected block to return true value.

Displaying 20 results from an estimated 20000 matches similar to: "RSpec Routing Error: Expected block to return true value."

2011 Mar 17
0
Testing route with proc --- possible and how?
I have this route (Rails 3) which handles redirecting shortened urls: # handles the shortened url lookup match '':hash'' => redirect { |params| Sharing.get_url_path_by_short_url(params[:hash]) }, :constraints => { :hash => /[a-zA-Z0-9]{7}/ } It works correctly at the ui. However am having trouble getting a spec working for it. Note that in the UI the user must be
2010 Jun 20
7
rspec-rails 2.0.0.beta.12 showing undefined method error for route_to
First of all, I''ve been trying to find an answer for this problem all over the internet without luck. The thing is that I am using RVM with ruby 1.9.2-head and I created a new empty gemset. Then I installed bundler gem with: gem bundler install That installed the library into the /Users/damselem/.rvm/gems/ ruby-1.9.2-head at rails3/gems directory. Then I went to my rails 3 app
2010 Oct 20
1
Routing errors with Rails 3.0.1 and Rspec 2.0.1
I''m sure something is borked in my app, but I can''t seem to track it down. A few commits back, my app was fully passing my spec suite. It was on Rails 3.0.0 and Rspec 2.0.0.beta.20. I''ve now upgraded to rails 3.0.1 and rspec 2.0.1 Now, I''m getting tons, and I mean tons of failures that say things like, to take a simple case: 113) SiteController GET
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
2012 Jul 12
0
Set requests' header inside spec/routing
I''m working on a Rails application having a REST API in JSON format and versioned (according to this excellent Ryan''s cast: http://railscasts.com/episodes/350-rest-api-versioning). For instance, there is a spec/requests spec: require ''spec_helper'' describe "My Friends" do describe "GET /my/friends.json" do it "should get
2011 Apr 07
3
[Rails 3] No route matches error using RSpec even though route DOES match
I''ve recently run into a really weird situation that I''m just not sure what''s going on here. I''m trying to write a route that will allow searches to be done via GET requests (generally a good idea since it''s just retrieving information, helps for links and SEO, etc.), and I have the route properly set up and can access it in development mode just fine,
2011 Apr 30
1
[rspec-rails] Is it bad form to use spec/requests/*_spec.rb for integration tests?
So I wanted to cook up a quick integration test for something, and I''m using rspec. I personally just don''t like Cucumber - just a personal preference, not a slam to the test framework at all - and wanted to stick to just pure rspec. So I dumped a quick spec file in spec/ reqests and ran it, and of course everything works. But is this considered bad form, or a less-than-good
2011 Jun 09
1
subdomain based namespacing makes RSpec incorrectly state that the route doesn't exist
Hello, I''m doing namespace routing based on subdomain, rather than path, so that http://admin.example.com/pages leads to app/controllers/admin/ pages_controller.rb. Cucumber is following this fine, but RSpec is complaining that the requested route doesn''t exist even though "rake routes" shows the route. When I add a standard namespace below the "scope :admin"
2009 Nov 10
10
Un-recognised routes that do exist, using namespaces & subdomain checking
I''m getting really cheesed off with RSpec not matching some of my routes when controller testing when I have subdomain checking (courtesy of subdomain-fu) on namespaces. These routes appear in the rake routes output, and work fine via HTTP requests . The really annoying thing is it''s working fine for routes that aren''t at the root of the namespace. E.g. say I have
2009 Mar 11
3
[rspec, rails] Restful Routes in controller specs
Hi, how is it possible that I can use the restful routes helpers (e.g. new_user_path) in controller specs? I browsed the source code but I couldn''t find the magic. I''m just curious and would appreciate any hint... thanks Andi
2008 Jun 15
2
RSpec story failing because of routing error on "/"
Greetings! Here''s the problem. When running tests on the restful_authentication plugin, I am getting a routing error on "/". Which I don''t really understand, because the route "/" certainly does exist as I can confirm when I run ./script/server and point my browser at http://localhost:3000/ Here is an example of the error I am getting when I run
2011 Jan 30
5
Named routes problem... more rails than rspec
Howdy, I have emailed before about the inconsistencies I''m spotting when using named routes/resource, but I think I''ve narrowed down the issue. It would seem this has nothing to do with rspec per se, but more with how routing works with rails. If you have an object instance, that isn''t saved and you attempt to generate a path for that item, even though the item may
2007 Sep 18
2
rSpec / Nested Routes / Mocks
I''m having a terrible time trying to test a nested route with rSpec. I can''t seem to tell rSpec to expect the call @item.user. The following error message plagues me not matter how I try to fuss with the mock: Spec::Mocks::MockExpectationError in ''ItemsController handling POST / items should redirect to the new course on successful save'' Mock
2011 Jul 14
1
RoutingError with RSpec Controller test on Scoped Route
So I have a route that looks like this: scope "4" do scope "public" do scope ":apikey" do resources :shops end end end And a bunch of controller specs, an example of which looks like this: describe ShopsController do describe "when responding to a GET" do context "#new" do it "should create a new instance
2007 Nov 12
1
Getting ''block not supplied'' with Rspec
Hi, I am usinh RoR w/ Oracle as my DB. For one my example in spec I get ''block not supplied error: Here is the sample code: Engagements::Engagement.find(:first).project_id I tried to google but did not find any substantial result other than http://www.nabble.com/Rspec-+-Oracle-t3756739.html where someone has faced such an issues. Wonder what could be the work around. Cheers, Amit
2009 Mar 02
2
Changes in specs for routes in rspec 1.1.99.x
Trying the next release of rspec, I have had to make changes in the existing specs for routing. I have written an script with sed that makes this automatically (two files) spec/upgrade.sed ================ /route_for/s/id => 1/id => "1"/g /route_for.*create/s/== \(["''].*["'']\)/== {:path => \1, :method => :post}/ /route_for.*update/s/==
2008 Dec 04
3
The RSpec way of doing this? Need help on validating block
Hello, I''m back again with more questions about mocks and how to do good testing in general. Let''s say I''m writing this EmailSender class and I want to make it totally awesomely tested with RSpec. Here''s how far I''ve gotten so far: require ''net/smtp'' class EmailSender def send_email
2008 Aug 19
5
RSpec raising routing errors where Rails doesn''t?
Hopefully someone here can help me figure out why the ERB: <% form_for(@fund, :url => {:host => PRIVATE_HOST}, :html => {:class => ''fund'', :multipart => true}) do |f| %> raises an error in my specs: No route matches {:action=>"index"} but works fine in my app and generates the following, desired HTML: <form
2013 Mar 27
0
Rspec + include Rails.application.routes.url_helpers
Hello there, I''m having some issues trying to test a custom helper. And I been trying to figure this out without luck. Please, see attachs for more information. Thanks in advance. Attachments: http://www.ruby-forum.com/attachment/8268/errors.txt http://www.ruby-forum.com/attachment/8269/spec_helper.rb http://www.ruby-forum.com/attachment/8270/products_helper.rb
2007 Nov 02
5
RSpec, RESTful nested routes and :path_prefix
Dear list, In the app we are making we have a rout something like this: map.resources :projects do |projects| projects.resources :pages, :controller =>"Wiki::Pages", :path_prefix => "/projects/:project_id/ wiki", :name_prefix => "project_wiki_" end But I can''t get RSpec(I''m very new to it) to accept this. It keeps throwing errors: