similar to: Cryptic error message when no controller_name

Displaying 20 results from an estimated 1000 matches similar to: "Cryptic error message when no controller_name"

2007 Jan 29
0
mock.with(Hash) expects an Array ?
Hi all, I looked at the open issues on the bug tracker, but couldn''t find anything related to this. I also searched the archives. And I can''t believe someone didn''t hit on this before. Here''s my spec: context "A project owner" do controller_name :roles setup do controller.stub!(:current_user).and_return(@user = mock("user"))
2007 May 10
12
shared descriptions -- a couple of issues
Hello All, I''ve just upgraded to rspec/rspec_on_rails 0.9.3 and am very excited about shared descriptions. They couldn''t have come at a better time: I just finished refactoring some REST controllers so that the bulk of the actions are inherited from a superclass. Now I can write the specs once, too. :) I''ve hit a couple of snags, though. I thought I''d
2007 Oct 11
2
Incompatibility Issues after updating CURRENT
Hi, I''m using piston to manage rspec and rspec_on_rails in vendor/plugins. ---- ~/work/simplify_md $ piston st vendor/plugins/ vendor/plugins/rspec (svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec) vendor/plugins/rspec_on_rails (svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails) ---- After I ''piston update''d rspec and
2007 Oct 22
1
installing rspec/rspec_on_rails as system wide generator (or similar)
Hi all, What would be the best/easiest way of installing rspec as a system wide generator so I''m not having to download it or ./script/plugin install it every time? Thanks, Alastair ----- Alastair Moore Freelance web design, development and consultancy t. 07983 983945 e. alastair at kozmo.co.uk w. http://www.kozmo.co.uk skype. alastair_kozmo
2007 Feb 07
11
Running patched rails
Hi, Does anyone have any tips for running a patched version of rails? I am currently running rails 1.2.2 and would like to keep up to date with any future releases. I also want to run with the following patch: http://dev.rubyonrails.org/ticket/5748 I am unsure how to manage this. Is this something SVN or rake can handle? Any tips/pointers would be very much appreciated. Thanks, GiantCranes
2007 Apr 12
1
rspec on rails: undefined method ''controller_name''
Im trying to write a controller spec, but when I run it I get an error like the one below. I found Bug6707 (http://rubyforge.org/pipermail/rspec-devel/2007-March/002147.html ), but I get the error no matter how I run the spec ( whether I use rake or not) Any ideas? I am using 0.8.2 The Error: C:/rails/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/expectati ons/sugar.rb:14:in
2007 May 17
4
How to mock helpers in view specs ?
Hi all, I am mocking the following Rails view (inside a partial): <%= render :partial => "forums/forum", :collection => forum_category.forums.readable_by(current_user? ? current_user : nil) %> My spec fails with the following message: 1) ActionView::TemplateError in ''forum_categories/index (anonymous user) should only render forums accessible to anonymous
2007 Oct 23
6
Problem Upgrading from 1.0.5 to 1.0.8
Hey Guys, I''m getting the following error: 1) NameError in ''ProductsController with a GET to /products NO NAME (Because of Error raised in matcher)'' uninitialized constant Spec::Mocks::BaseExpectation::AnyArgsConstraint /Users/mattlins/Projects/RailsProjects/SWNetworkServices/vendor/plugins/rspec_on_rails/lib/spec/rails/dsl/behaviour/render_observer.rb:86:in
2007 Jan 24
7
Differences between assert_tag and assert_select
Hi all, I can't seem to make assert_select work for the more complex cases for me. Here's a sample: # View <%= link_to_remote 'Add new', :url => new_phone_url, :submit => 'phones_head' %> # Generated code: <a href="#" onclick="new Ajax.Request('http://test.host/admin/parties/phone/new', {asynchronous:true, evalScripts:true,
2006 Dec 08
2
Windows Tempfile Fix Plugin
Hi all, Yesterday, I had some problems reading JPG files in my tests. Turns out the problem was that Windows Ruby doesn't set it's Tempfile to work in binary mode. Since I deploy on Linux, that has never been a big problem, but now I'm working on some software that works with binary files exclusively. Anyway, I am making this fix available as a Rails plugin. The details can be
2006 Dec 08
2
Windows Tempfile Fix Plugin
Hi all, Yesterday, I had some problems reading JPG files in my tests. Turns out the problem was that Windows Ruby doesn't set it's Tempfile to work in binary mode. Since I deploy on Linux, that has never been a big problem, but now I'm working on some software that works with binary files exclusively. Anyway, I am making this fix available as a Rails plugin. The details can be
2006 Oct 25
2
Isn''t it possible to stub / expect on :id ?
Hi all ! Running this: @payout = stub_everything(:id => 141) Payout.stubs(:find).with(@payout.id).returns(@payout) Generates this warning: ./test/functional/payouts_controller_test.rb:22: warning: Object#id will be deprecated; use Object#object_id What am I missing ? :id is a fairly frequent method to override in Rails-based applications. I''m using Mocha from
2007 Nov 28
6
Broken edge
Hi all, Not sure if I''m the only one with this problem... We''re on edge for both rails and rspec, and i just did an update... Some apparently innocuous rails stuff was updated, and then half my specs broke due to an error in rspec_on_rails: ArgumentError in ''UserController without logged in user should show the index page'' wrong number of arguments (2
2008 Jan 21
5
attachment_fu and story runner, any updates
I''m trying to write a story for a Rails app which involves using the attachment_fu plugin to upload images. After blunting my pick on this for a while, google found me this: http://www.ruby-forum.com/topic/134743#600831 So it seems that there''s a hole in Rails integration testing and multipart form posting. David offered to incorporate a patch to story runner at the end of the
2007 Jul 31
11
helper spec not finding rails core helpers
Hi, My helper specs were going ok until I added a call to a rails DateHelper method in one of my helpers http://api.rubyonrails.com/classes/ActionView/Helpers/ DateHelper.html#M000574 The helper runs fine from my view templates, just dies in the spec test. I boiled my question down to a simple (not too useful) example. I''m not sure what I''m missing. #
2007 Jan 21
35
Collection proxies need to be stubbed ?
Hi all ! I just started writing specs on a new project. I would just like to validate that this is the way you would write it. I know about mocks, stubs and expectations. I don''t think this is a problem for me. My question really boils down to: def index @projects = current_user.projects.active end My spec needs to return the proxy, no ? Here''s my code: context "A
2006 Nov 28
2
Partial matches in expectations
Hi ! I would like to ascertain the following in a test case: @template.expects(:content_tag).with(:fieldset, :__any_arguments__i_dont_care) Is it possible to do so ? If so how ? If not, is it something the community wants ? Is it useful ? Thanks ! -- Fran?ois Beausoleil http://blog.teksol.info/ http://piston.rubyforge.org/
2007 Mar 27
1
Ticket #7124
http://dev.rubyonrails.org/ticket/7124 I just attached a patch against 1.2 that cleanly applies to trunk too. This allows functional and integration tests to have the same interface to the xhr/xml_http_request method. The patch also includes a deprecation workaround when called without the appropriate parameters. If the patch could also be applied to the 1.2 branch, I would appreciate. The
2007 May 02
13
RSpec 0.8.2 pain, missing spec/rails?
Hi. I''m upgrading a project from an 0.8.0 pre-release gem to 0.8.2. I''ve installed the 0.8.2 gem, and the rspec_on_rails 0.8.2 plugin: ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/REL_0_8_2/rspec When I try to run my specs though, I get the below error. It''s as if the spec_helper cannot find "spec/rails". I''ve noticed that
2007 Feb 06
2
Testing RJS actions
Hi all ! This is my test: def test_destroy_xhr Article.expects(:find).with("1").returns(@article = mock("article")) @article.expects(:destroy).returns(true) delete :destroy, :id => 1, :format => :js assert_template "destroy.rjs" end And my implementation: def destroy @article.destroy respond_to do |format| format.html {