It looks like the tests are passing, but maybe you should be a little more specific in your tests. You mainly check that the nbr of records are increased and that you get a successful response.
I would test that the correct view gets rendered, maybe that the assign variables in the controller really is the book-record(s) you are assuming, and that the updated records really set the values that send as parameters. How much you would test also depends on what our kind of test suites you have. If you have tests at a higher level (like selenium) maybe you could remove some the tests in functional tests. If you dont trust your test-suite, you are not testing enough :) Good luck, Kristian Hellquist 2009/12/5 sanjanad <[email protected]>: > > > my tests are running with no errors.. > > but how do i check whether the functional tests i wrote are working..i > need please.. > > require File.dirname(__FILE__) + '/../test_helper' > > class BooksControllerTest < ActionController::TestCase > > def setup > �...@controller = BooksController.new > �...@request = ActionController::TestRequest.new > �...@response = ActionController::TestResponse.new > login_as :sanj > end > > fixtures :books > > def test_should_get_index > login_as(:sanj) > get :index > assert_response :found > assert_nil assigns(:book) > end > > def test_should_get_new > login_as(:sanj) > get :new > assert_response :found > end > > def test_should_update_book_name > login_as(:sanj) > assert_difference('Book.count',0) do > post :update, :book => {:name => "shkj"} > end > end > > def test_should_get_details > login_as(:sanj) > assert_difference('Book.count',0) do > get :book =>{} > end > end > > def test_should_update_num_of_books > login_as(:sanj) > assert_difference('Book.count',0) do > post :update, :book => {:num_books => 7} > end > end > > def test_should_update_book_buyin > login_as(:sanj) > assert_difference('Book.count',0) do > post :update, :book => {:buyin => 20} > end > end > > def test_should_update_book_book_fee > login_as(:sanj) > assert_difference('Book.count',0) do > post :update, :book => {:book_fee => 1200} > end > end > > def test_should_create_book > login_as(:sanj) > assert_difference('Book.count',0) do > post :create, :book => {:name => "ssss",:num_books => 5,:buyin > => > 1000,:book_fee => 1500} > end > end > > def test_should_edit_book_name > login_as(:sanj) > assert_difference('Book.count',0) do > post :edit, :book => {:name => "sshh"} > end > end > > def test_should_update_book_details > login_as(:sanj) > assert_difference('Book.count',0) do > post :update, :book => {:name => "sshf",:num_books => 10, :buyin > =>3000, > :book_fee => 4000} > end > end > > def test_should_edit_no_of_books > login_as(:sanj) > assert_difference('Book.count',0) do > post :edit, :book => {:num_books => "6"} > end > end > > def test_should_edit_the_book_details > login_as(:sanj) > assert_difference('Book.count',0) do > post :edit, :book => {:name => "sssss",:num_books => 5, :buyin =>2000, > :book_fee => 2000} > end > end > > def test_should_edit_book_fee > login_as(:sanj) > assert_difference('Book.count',0) do > post :edit, :book => {:book_fee => "1600"} > end > end > > def test_should_edit_book_buying > login_as(:sanj) > assert_difference('Book.count',0) do > post :edit, :book => {:buyin => "1200"} > end > end > > def test_should_show_book > login_as(:sanj) > get :show, :id => 1 > assert_response :found > end > > def test_should_edit_book > login_as(:sanj) > get :edit, :id => 1 > assert_response :found > end > > def test_should_update_the_book_name > login_as(:sanj) > put :update, :id => 2, :book => {} > end > > def test_should_update_book > login_as(:sanj) > put :update, :id => 1, :book => { } > end > > def test_should_destroy_book > login_as(:sanj) > assert_difference('Book.count',0) do > delete :destroy, :id => 1, :admins_id => admins(:sanj).id > end > end > end > > is this correct functional tests???..how do i check whether the tests > i > wrote are correct??.. > > they are executing without errors... > > Loaded suite test/functional/books_controller_test > Started > ........................ > Finished in 0.379324 seconds. > > 24 tests, 25 assertions, 0 failures, 0 errors > > but how do i check whether they are correct tests??..i need helppp > pleaseee > > thank you > > Reply with quote > > -- > > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

