Displaying 2 results from an estimated 2 matches for "closed_site".
Did you mean:
close_site
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:
2007 Oct 15
0
Fwd: Content filtered message notification
...icated_system.rb
What happen is that the stub have no effect and the real method is still
executed.
Here is the code. Any idea ?
Thank you
require "#{File.dirname(__FILE__)}/../test_helper"
class CheckStopsiteTest < ActionController::IntegrationTest
fixtures :users
def test_closed_site
AuthenticatedSystem.stubs(:login_required).returns(true)
get ''/admin/maintenance/stop_site''
assert_response :success
get ''/fr/site''
assert_redirected_to :controller => ''site'', :action => ''closed_site''...