search for: current_account

Displaying 6 results from an estimated 6 matches for "current_account".

2010 Nov 29
0
[TDD] [Rails] - Rspec test for application_helper.rb fails when trying to access application_controller method.
In a method named logo in my application helper, I reference an application controller method (current_account) that has been marked as a helper method with the following syntax: helper_method :current_account When I test out the setup in the browser (without rspec), rails is happy with this setup. However, when I run the spec, the spec won''t pass and gives me the following error: Failures:...
2008 Jun 28
19
Stopping example execution?
Hello, I''m wondering If I am missing something here when creating an example that sets an expecation at the top or beginning of an action but requires you to stub / mock everything that follows. Example: I want to test that a certain controller is running a before_filter...thats easy: - controller.should_receive(:require_user) - do_get But now i''ve got to mock / stub
2007 Feb 06
2
Login systems : stubbing accounts and AR association proxies
...ever resource I''m dealing with in that given test. All the login/ ownership stuff could be handled in integration testing, which is probably better suited to it anyway, due to having real sessions etc etc. I''m having difficulty doing so, however. The controller uses some current_account / current_client methods to find whoever''s logged in - stubbing those to return a fake client/account is easy, but you''re then left with problems with Rails'' association proxies. There''s lots of use of things like current_client.scenes.build, which are...
2007 Dec 07
4
strange error on mock proxy
...@unit.root? -%> 11: <li> 12: <label for="unit_parent_id"><%=h ''Parent Unit''.t %></label> 13: <%= f.select :parent_id, [1,2,3] %> 14: <%#= f.select :parent_id, 15: nested_set_options_for_select(current_account.units.root) {|u| "#{''?'' * u.level} #{u.name}"} %> 16: </li> vendor/plugins/rspec/lib/spec/mocks/proxy.rb:71:in `send'' vendor/plugins/rspec/lib/spec/mocks/proxy.rb:71:in `message_received'' vendor/plugins/rspec/lib/spec...
2006 Jul 31
0
MY worker won''t stop working
...s_cdr class: def stop_process @running = false end def process @running = true @time_start = Time.new.to_f @files_processed = 0 phone_service_accounts = PhoneServiceAccount.find(:all) phone_service_accounts.each do |myPsa| process_class_name = myPsa.process_class @current_account = myPsa.name if @file.strip.length == 0 @phone_service_cdr = PhoneServiceCdr.find(:all, :conditions => "processed = ''n''") else @phone_service_cdr = PhoneServiceCdr.find(:all, :conditions => "processed = ''n'' AND name=...
2007 Nov 28
6
Newbie question
I installed Rspec and am getting the following failure: $ sudo gem install rspec Successfully installed rspec-1.0.8 Installing ri documentation for rspec-1.0.8... Installing RDoc documentation for rspec-1.0.8... $ spec -v RSpec-1.0.8 (r2338) - BDD for Ruby http://rspec.rubyforge.org/ $ cat acct.rb describe Account, " when first created" do it "should have a balance of $0"