search for: testresponse

Displaying 20 results from an estimated 44 matches for "testresponse".

2007 Jun 12
3
rspec 1.0.x and liquid?
...;' spec/controllers/buyer_controller_spec.rb:57: spec/controllers/buyer_controller_spec.rb:63: should render_template is looking for 11: def matches?(response) 12: @actual = response.rendered_file(!expected.include?(''/'')) 13: actual == expected 14: end TestResponse.rendered_file looks like 208: def rendered_file(with_controller=false) 209: unless template.first_render.nil? 210: unless with_controller 211: template.first_render so TestResponse is missing ''template''. Any clues? Courtenay http://blog.caboo.se...
2006 Apr 27
6
Functional Test Problem. Nubee, please help
...n a functional test? Im assuming i use the setup method to login the controller. This is the setup method for the Activities controller functional test: def setup @controller = ActivitiesController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new end my "login" controller has a method "authenticate" which needs params[:username] and params[:password]. Please help! Thanks Allen -- Posted via http://www.ruby-forum.com/.
2007 Jun 21
3
only checking certain parameters for a method
...member.expiration_date = "9/19/2007" member.payment_method = "bogus" member.first_name = "Steve" member.last_name = "Eichert" member.expects(:active_merchant_gateway).returns(gateway) member.expects(:purchase).with(1000, :any).returns(TestResponse.new) member.charge end On a slightly unrelated note, I was trying to find a way to search the mailing list archives here: http://rubyforge.org/pipermail/mocha-developer/but wasn''t able to figure anything out. Does anyone have any suggestions? Cheers, Steve
2006 Dec 31
2
what''s with the response.should_be_xxxx stacktrace?
If I do get :index response.should_be_success I get about 20k of marshalled dumpage that starts like #<ActionController::TestResponse:0x390443c @body=\"<html><body>You are being <a href=\"http://test.host/carts/1\">redirected</a>.</body></html>\", @assigns=[], @redirected_to={:action=>\"show\", :id=>1}, @template=#<#<Class:0x38d5fc4>:0x38d5f9c @assig...
2006 Feb 03
2
testing to see if emails are sent out on exceptions
Hi, I''m using ActionController::rescue_action_in_public() to send emails when uncaught exceptions happen. Is it possible to write tests for that? Joe
2007 Feb 15
1
Specs for RJS HTML output NOT containing an element
...ve(*opts) rescue Spec::Expectations::ExpectationNotMetError else fail_with("Expected no matching elements but at least one was detected.") end end end end end module ActionController class TestResponse def should_not_have(*opts) __assert_select_wrapper.should_not_have(*opts) end end end Is there already a way of doing this, or a better (shorter) way than above? Ashley
2006 Jun 16
0
rake spec controller test output hideus.
...ontrollers/home_controller_spec.rb" "spec/controllers/links_controller_spec.rb" "spec/controllers/user_controller_spec.rb" .......F. 1) ExpectationNotMetError in ''The UserController should not allow new users without the correct fields'' ActionController::TestResponse #<ActionController::TestResponse:0x24d6880 @body="<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\n\t\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n<html>\n<head>\n\n\t<title>Me Ruby, You Jane</title>\n\t<meta http-equiv=\"Co...
2007 May 26
11
RSpec
Hi RSpec Mailing list, I''m new to RSpec and I am trying to get it running with the caboo.se sample rails app. I installed the current version of rspec with rspec_on_rails I tried to run rake spec but received: 330-07:~/desktop/restful_auth_rspec/vendor multimedia$ rake spec (in /Users/multimedia/Desktop/restful_auth_rspec)
2006 Oct 12
2
Test should fail !
...ught by the controller. class AlertsController; def rescue_action(e) raise e end; end class AlertsControllerTest < Test::Unit::TestCase fixtures :clients def setup @controller = AlertsController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new end def test_get_index get :index assert_response :success end end -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group....
2005 Mar 09
9
Unit testing + instance variables
..._FILE__) + ''/../test_helper'' require ''recipe_controller'' class RecipeControllerTest < Test::Unit::TestCase def setup @controller = RecipeController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new create_fixtures "recipes" create_fixtures "categories" end def test_list get :list # This step seems exessively complex, and took me a while to figure out my_inst_vars = @controller.instance_variable_get "@assigns"...
2006 Jul 02
5
"the number of parameters does not match the number of substitutions" error
...ut it happens now when I downgrade to 1.1.2. Here''s test/functional/account_controller_test.rb: class AccountControllerTest < Test::Unit::TestCase def setup @controller = AccountController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new end def test_index get :index assert_redirected_to :action => ''login'' # LINE 16 end def test_login get :login assert_valid_markup end end Any ideas? Thanks, Joe
2007 Nov 09
26
RSpec on Rails 2.0
I have a project on edge rails that I''m trying to convert from Test:Unit to rspec. I have the rspec gem version 2338, the rspec and rsepc_on_rails version 2831 in vendor/plugins, and rails version 8117 in vendor/rails. I''ve been able to get a few specs passing, have gotten the specs running from autotest, and am able to do "rake spec:doc" and get the basic command
2010 Sep 30
5
response.should have_text leads to undefined method `has_text?'
...s some JSON output that I would like to test with RSpec. For that I use ''response.should have_text("foobar")'' in my spec file, but that leads to a Failure/Error: response.should have_text("enim") undefined method `has_text?'' for #<ActionController::TestResponse: 0xb6736944> I read here somewhere that webrat should be in the Gemfile, but that also did not solve the problem. Best regards, Kai
2006 Jun 27
4
Action Mailer - weird rendering issues
Hello, While sending email notifications from ThoughtNotifier, I am getting weird exceptions, which sometimes occur on the production machine, but I haven''t been able to reproduce on my development machine. There should be no error while rendering `thought_notifier/share_notification.rhtml'' template, but if for some reason it is rendering
2006 Apr 18
7
Functional test, pls help!!!!
Hi guys, recently encountered this funny problem which i really dunno wat happen... I have been trying on it for the past few days and just doesnt work.Hope you guys can give me some enlightenment. Problem: The functional test doesnt seems to be able to recognise one of my model, and when i run the test, it keeps giving me the error of"You have nil object when you don''t expect
2006 Aug 11
1
Calling a Controller method from the command line
Hi All, I need to run some reports via cron. I know I can use runner and call a method in a model class. But I''d really like to use templates and IMO this kind of logic belongs in a controller anyways. These are periodic reports so I don''t need nor want to leave a server running all the time, so getting the data via curl/wget isn''t really an option. What I really
2006 Apr 28
2
tests and login_engine
Hi there, I just started writing tests today after some months of using rails (slap wrists). I seem to be getting the hang of things, but I''m hitting a wall when it comes to functional_testing pages protected by login_engine/user_engine. all my assertions come back with: Expected response to be a <:success>, but was <302> Is there a way I can login from within a test?
2006 Feb 01
3
Testing components
...' # Re-raise errors caught by the controller. class NewsController; def rescue_action(e) raise e end; end class NewsControllerTest < Test::Unit::TestCase def setup @controller = NewsController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new end # Replace this with your real tests. def test_content get :content assert_response :success assert_rendered_file "content" end end But running that gives me: 1) Error: test_content(NewsControllerTest): NoMethodError: undefined method `controller_path...
2006 Jan 14
0
testing template components
...lication "test" directory. No problem. Next copy the setup method, and set it up like so - class SidebarControllerTest < Test::Unit::TestCase def setup @controller = Navigation::Sidebar.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new end def test_setup assert true end end Nope, that throws an error that makes me think I am headed in the wrong direction- 1) Error: test_get_menu(SidebarControllerTest): NoMethodError: undefined method `new'' for Navigation::Sidebar:Dependencies::LoadingModule functi...
2005 Dec 29
1
Posting to a separate controller in a functional test
Hi, I need to post to a controller to log in a user in a functional test, but I''m not sure what to do to post to a separate controller. I''ve tried: post { :controller => :account, :action => :do_login }, { bla bla bla } But that doesnt seem to have worked. Help? Mitch -- Posted via http://www.ruby-forum.com/.