similar to: RSpec-Rails bug with to_xml?

Displaying 20 results from an estimated 4000 matches similar to: "RSpec-Rails bug with to_xml?"

2008 Jan 23
2
integrate_views is not executing my views
I wanted to use "integrate_views" as Ryan explains in his RailsCast #71 (http://railscasts.com/episodes/71) ...but I can''t get it to work: the view code in not executed I looked everywhere but I can''t understand what I am doing wrong. Here is what I did: I created a new application from scratch (Rails 2.0.2), added rspec and rspec_on_rails plugins, and run
2007 Jul 24
6
Mocking Access Control
I''m trying to jump on the TDD/BDD bandwagon, but am having trouble understanding how i should mock my user. The user has a habtm relationship to a roles model (acl_system2 plugin), but I''m not sure how to tell rspec about a model. My code: describe UsersController do integrate_views before(:each) do @user = mock_model(User)
2007 Nov 18
9
Not sure why this is failing
I am not sure why the tests don''t see the call of the new method for the Address class. It can be seen in the controller method where the Address.new is called. >> @address = Address.new(params[:address]) What am I doing wrong? Thanks for the help. Here is the error message: Spec::Mocks::MockExpectationError in ''UsersController handling POST /users should create a new
2008 Jun 04
2
Is Ferret''s SVN repository down?
Is Ferret''s SVN repository down? I''m trying to get the source from svn://davebalmain.com/ferret, but I keep getting "Connection Refused" errors. Did the URL change, or is Ferret''s repository really down? -- Bira http://compexplicita.wordpress.com http://compexplicita.tumblr.com
2008 Mar 01
3
Possible bug when creating a Ferret::Search::Sort object?
I may have run across a bug in Ferret: if throws a segmentation fault when I try to create a Sort object using the default fields (SCORE and DOC_ID), but setting reverse to true. Here''s the minimal example: #!/usr/bin/env ruby require ''rubygems'' require ''ferret'' Ferret::Search::Sort.new Ferret::Search::Sort.new( [
2008 Jun 04
5
controller filters running twice in 1.1.4?
since upgrading to 1.1.4 (I had been running without issue on a git snapshot), I''m noticing that my filter actions initiated from application.rb seem to be running twice. I created a test rails project with the rspec scaffold and am also seeing the same behavior here too. Adding this code to application.rb: before_filter :foo def foo "foo" end and an example
2007 Dec 04
10
Unexpected message on :attr_accessor
This may be a dumb noob issue, but I haven''t found any answers while seaching the forum-- I have a controller method def edit @user = User.find params[:id] @user.password_confirmation = @user.password end The User class has an "attr_accessor :password_confirmation" definition (so "password_confirmation" doesn''t exist in the users table). My spec
2008 Mar 12
2
Warning: integrate_views and nested description groups
describe MyController do integrate_views describe "A common base senario" do it "no longer integrates views" do be_careful end end end integrate_views affects an attribute in the class formed by the describe factory method. The second describe generates its own class, so integrate_views is OFF at that level. I''ve already spent far, far too much
2008 Apr 04
1
Bug Report: Segmentation Fault when indexing with a specific set of FieldInfos.
I''m submitting this through the mailing list because Trac won''t let me use its bug report form... Is there some more appropriate way of submitting bugs if Trac doesn''t work? This is the Trac error message: 500 Internal Server Error (Submission rejected as potential spam (IP 127.0.0.1 blacklisted by bsb.empty.us, sc.surbl.org, Maximum number of posts per hour for this
2008 Feb 19
3
render_to_string in a controller test?
Hi all, I know that in general, view and controller tests should be isolated, such that controller specs don''t test views etc. However, I think I''ve run into a situation that might be an exception. My controller uses render_to_string to produce a chunk of HTML that it passes to a model to be processed. The controller then redirects the user to a different page. The
2007 May 23
2
rspec mocha and controller specs without integrated_views
The ability to choose a mocking framework is great as I prefer mocha, but I am have problems. On my controller specs, I am forced to ''integrate_views'' as the following code below shows you, the mocking of views is rspec specific. See stub! versus mocha''s stub unless block_given? unless integrate_views?
2008 Feb 22
7
Testing misc methods in ApplicationController
I''m already successfully testing before_filters in application_controller courtesy of this blog post: http://www.movesonrails.com/articles/2008/01/23/spec-ing-your-application-controller However, i can;''t work out how to test the sort of method that is added to application_controller so that all controllers can use it. It must be something simple that i''m doing
2009 Sep 30
1
2 RESTful controllers for the same resource
Hi everyone I want to have two restful controllers for the same resource (Users) One controller (UsersController) is straight in the controllers folder and is used for singup and so on Then i need another controller for users which is inside an admin folder (Admin::UsersController) In my routes.rb i have map.resources :users # Sample resource route within a namespace: map.namespace
2008 Oct 24
4
Correct way to spec partials
Hi everybody, 1) Does anybody have full working example of how to test partial templates? 2) What the correct place to test partials: controller or view spec? If controller correct place, should I use integrate_views? 3) Is it true that expect_render is deprecated and I have to use should_receive(:render) 4) How to test that partial''s locals hash is correct? Thx -------------- next
2008 May 26
7
Mocking Models in Controller Specs...
I find myself doing this kind of thing a lot in Controller Specs: @vacancy = mock_model(Vacancy) @vacancy.stub!(:reference) @vacancy.stub!(:title) @vacancy.stub!(:created_at) @vacancy.stub!(:updated_at) @vacancy.stub!(:body) @vacancy.stub!(:contract) @vacancy.stub!(:location) @vacancy.stub!(:salary) @vacancy.stub!(:benefits)
2009 May 01
4
Can't get to an action in a RESTful controller
Folks, I am using the restful_authentication plugin. This creates the users controller which is declared as a resource in routes.rb as below map.resources :users Now in the UsersController I have created an action to resetpwd that I am trying to get to from the login page when the user clicks "forgot password". However, when I do that the log file tells me that the call to
2008 Aug 25
21
How much test data to use in specs
I''m not sure how much test data I should be using in my specs. I''m writing specs for the Property model in my Rails app. Its "address" attribute is going to be validated with this regex: /\A\d+[a-z]? [-'', a-z]{2,128}\Z/i At the moment, my plan is to spec out the following possibilities. A property is invalid if its address: 1) doesn''t begin with
2008 Apr 03
1
Anyone experienced RSpec/Autotest forgetting models?
Hi Saving a controller spec frequently gives me this error: 52) LoadError in ''UsersController GET /users with basic request params should find all the user types'' Expected /home/amoran/Documents/becta/apps/Backend/app/models/user_type.rb to define UserType ./spec/controllers/users_controller_spec.rb:299: script/spec:4: I have to Ctrl-C autotest before it will load again.
2007 Jan 05
4
How To Spec Controllers with Finders
Given this code (which renders rjs), I''m faced with the fixture- driven way of spec-ing or mocking. How the heck to you mock this so the code at line (2) and (4) work right? I''m still struggling with mocks but it seems like this can be done. Forgive the naivety of this question. 1. def change_quantity 2. @line_item = LineItem.find_by_id(params[:id]) 3. unless
2011 Jan 17
1
Using integrate_views for all controller specs
Is there a way to always use integrate_views for all controller specs? I hate having to remember to insert that line into each one. Thanks, Joe