similar to: Testing a call to super

Displaying 20 results from an estimated 1000 matches similar to: "Testing a call to super"

2007 Jul 30
6
Object.stubs doesn''t seem to work.
Hi I''m using Mocha 0.5.3 and I want to stub out a call to Time.now, just like the example in the post http://blog.floehopper.org/articles/2007/06/08/mocha-0-5-released However, trying it in irb gets me the following error: >> require ''mocha'' => true >> Time.stubs(:now).returns(Time.parse(''Thu Feb 01 00:00:00 UTC 2007'')) NoMethodError:
2006 Jul 14
8
CAS Authentication filter.
Hi CAS is a centralized authentication service, and the cas_auth filter can be installed to automatically make your web application authenticate against a CAS server. The SVN path to the plugin is http://svn.ki.se/rails/plugins/cas_auth and a homepage with some information can be found at http://opensource.ki.se/casauth.html For use, just install the plugin in your application and set
2006 Jul 21
4
Autocompleting InPlaceEditor
Hi, I''ve created some extensions to script.aculo.us InPlaceEditor, allowing the use of either server-driven, or local autocompletion. I''ve also created new helper methods in Rails for this functionality. My question is, is there any interest that I package this and make it available as a plugin, or something like that? Regards -- Ola Bini (http://ola-bini.blogspot.com)
2006 Aug 06
6
Having Problem w/ Agile Web Development book
I get this error ... NoMethodError in StoreController#index undefined method `salable_items'' for Product:Class and here is my store_controller.rb ... class StoreController < ApplicationController def index @products = Product.salable_items end def self.salable_items find(:all, :conditions => "date_available <= now()", :order => "date_available
2007 Dec 28
1
JtestR 0.1 released
JtestR allows you to test your Java code with Ruby frameworks. Homepage: http://jtestr.codehaus.org Download: http://dist.codehaus.org/jtestr JtestR 0.1 is the first public release of the JtestR testing tool. JtestR integrates JRuby with several Ruby frameworks to allow painless testing of Java code, using RSpec, Test/Unit, dust and Mocha. Features: - Integrates with Ant and Maven - Includes
2006 Aug 07
5
Store SOAP::RPC::Driver in user session throws TypeError
Hi All I have a requirement to consume a 3rd party web service from my Rails application. I am doing this in my action require ''soap/wsdlDriver'' factory = SOAP::WSDLDriverFactory.new(TRANSIDIOM_WSDL_URL) soap = factory.create_rpc_driver soap.wiredump_file_base="#{RAILS_ROOT}/log/transidiom.log" param = %(<Request
2006 Jul 14
4
sending additional parameters to before_filter
i am trying to create a system so that different users have different priviliges on my application. i was going to modify my authorize function so that i could pass the required role to it and have it check the current user for that role. i am using before_filter and would like to have just one function instead of writing one for each role like so: authorize(role) instead of:
2006 Aug 03
3
Swedish Rails
I would like to announce my plugin Swedish Rails. Rails provide many goodies and helpers for you, but some of these are dependant on your user interface being in english. Date controls, for example. Pluralization is another. And have you ever tried to capitalize a string with Swedish letters in them? Then you know it doesn''t work that well. Until now, that is. You install this
2006 Jul 14
2
Configuration search order
Hi I''m in the process of deciding how a plugin should be designed to make configuration as easy as possible. Right now I require the plugin from init.rb, and set some configuration options (as class attribute accessors) from environment.rb. Then I tried setting these from environments/development.rb instead, and to my surprise this didn''t work. It said the class in question
2006 Aug 16
4
Plugins and svn
Hi railers, What do you do when you must use a plugin in a rails app that is under subversion? I think that an approach is simply install a version of the plugin, and once all the test pass, commit the plugin itself to the repository, inside the /vendor/ of the app. If a new version of the plugin is released, your app is still using the working one (although the new version could work too).
2008 Jan 28
9
Nested matchers
We''re encountering a failure with Mocha 0.5.6. We had this expectation: game_version.expects(:attributes=).with(:game_file => kind_of(GameFile), :game_id => @game.id) This expectation was passing with 0.5.5, but fails with 0.5.6. I added this test to parameter_matcher_acceptance_test.rb, which passes in 0.5.5 and fails in 0.5.6 def test_should_match_nested_parameters
2006 Jul 22
1
InPlaceEditor with Autocompletion
Hi Rails AJAX controls are very handy, and the InPlaceEditor is probably one of the easiest and most neat of them all. But, it doesn''t do autocompletion. I''ve rectified that situation. The plugin provides a few new helpers and a new JavaScript-file that extends the Ajax.InPlaceEditor with local and remote Autocompletion features. So, just install the plugin, include the
2007 Mar 30
7
problem with using any_instance
Hey all, I have a question with using mocha in my tests. In the same test file, I have two tests, <code> def test_a klass.any_instance.stubs(:method_name).returns("something") klass.new.method_name ... end def test_b ... klass.new.method_name ... end </code> where klass is some class when the tests run, test _a passes, but test_b had an error like this:
2007 Sep 11
3
Expectations on portions of arguments called.
I''d like to create expectations on just portions of the arguments a function takes. For example, I want to verify that the a certain ActiveRecord association extension adds an order clause to the find options hash. Currently I simply check the entire argument structure, something like this def test_referring_journals_should_order_by_citation_count article =
2006 Dec 02
3
Scoping expectations and more ...
Hello! I''m new to Mocha and through experimentation I found out something that is not explicitly stated in the documentation: If you need to mock the same function call with different parameters and results, you can set the scope of expectations with a begin ... end block. I also made up an example on how to expect more than one function call with different parameters and return values.
2007 Sep 21
5
Stubbing yielding methods
I''ve just been tying my brain in knots looking at bug #8687 ( http://rubyforge.org/tracker/index.php?func=detail&aid=8687&group_id=1917&atid=7477 ). I''ve been (1) trying to work out whether there is anything logically wrong with Mocha''s existing behaviour and (2) whether Mocha should support the requested functionality. It all centres around the use of the
2006 Aug 03
5
Rails - forms
Currently I have a registration form that is built like this: <label for="First name">First name</label> <%= text_field "user", "first_name" %><br> <label for="Last name">Last name</label> <%= text_field "user", "last_name" %><br> <label for="Email">Email</label>
2006 Oct 13
6
If I stub do I have to mock as well?
Hi, I''m new to mocha and stubba but eager to learn. I have a rails functional test in which I would like to stub an instance method of particular class to always return true. I tried the following: def test_post_checkout Order.any_instance.stubs(:successful?).returns(true) post :checkout assert_response :redirect assert_equal "Checkout was successful.",
2006 Aug 03
5
Database configuration across developers!
Hi, I have what might be a silly question but is there any way to put some of the database configuration information into a separate file? For instance, in config/database.yml I have: developer_database: &developer_database adapter: mysql username: me password: something host: 127.0.0.1 development: <<: *developer_database database: foobar_development test: <<:
2008 Jun 12
2
Google Group?
A number of people have had difficulties subscribing and/or sending messages to the existing mailing list. Also I have to spend quite a bit of time moderating spam and the mailman interface is pretty clunky. So I was contemplating setting a Google Group up instead. Does anyone have any objections? -- James. http://blog.floehopper.org http://tumble.floehopper.org