search for: test_edit

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

Did you mean: test_bit
2006 Feb 01
3
Test data life cycle confusion
...tests. Well, I''ve been running into a brick wall with some functional tests based off of what the scaffold generator created for me. Here''s a couple snippets: articles.yml: first: id: 1 published: 1 publish_on: 2006-01-24 14:50:30 articles_controller_test.rb: <snip> def test_edit get :edit, :id => 1, :version_id => 1 assert_response :success assert_template ''edit'' assert_not_nil assigns(:article) assert assigns(:article).valid? end def test_destroy assert_not_nil Article.find(1) post :destroy, :id => 1 assert_response :redirect assert_redirecte...
2006 Jun 27
2
testing - how to get access to an instance variable
inside controller def foo @city = City.find(@params[:id]) @city.bar = 1234 end While writing functional tests how do I ensure that the @city.bar is 1234? def test_edit get :edit, :id => 1 assert_not_nil assigns(:city) #?? how to assert that city.bar is 1234 end Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060627/d4861773/attachment.html
2006 May 04
6
second assert_tag failling in rails integration test
Hi all, I''m fairly new to rails and ruby, but I''ve come across an interesting glitch and I''m not sure whether I''ve just got something wrong with my assumptions or if it really is an error in the underlying framework... I''ve created a bare-bones set of tests to show you where the problem is. What follows are the steps I went through to reproduce the
2006 Jan 06
0
scaffold code fails functional test?
...cided to run functional test on the controller. Here is the result: 1) Failure: test_create(StudentControllerTest) [test/functional/student_controller_test.rb:55]: Expected response to be a <:redirect>, but was <200> Also from another action I get the following error: 2) Failure: test_edit(StudentControllerTest) [test/functional/student_controller_test.rb:68]: <false> is not true. I don''t undertand why this code fails and what the failure means. Can someone also please explain when to use redirect_to vs. render? Thanks for your help. -bakki kudva -------------- next...
2006 Aug 02
1
REST and functional tests
Just playing around with converting an apps to the new REST goodness in edge rails, and I''m trying to work out how to convert/write the functional tests. Is the recommended way to explicitly use the actions (e.g. get :show, :id => ...; post :create,..., etc) and test the routes separately, or duplicate the request, in which case how is that done get "/", :id => 5
2009 May 18
0
[PATCH server] fixed functional tests after recent controller refactoring and managed node controller fixes.
...n => 'show', :id => pools(:default).id - end - - def test_create - num_hosts = Host.count - - post :create, :host => {} - - assert_response :redirect - assert_redirected_to :controller => 'dashboard' - - assert_equal num_hosts, Host.count - end - - def test_edit - get :edit, :id => @host_id - - assert_response :redirect - assert_redirected_to :action => 'show', :id => @host_id - - assert_not_nil assigns(:host) - assert assigns(:host).valid? - end - - def test_update - post :update, :id => @host_id - assert_respons...