# How do i check whether my functional tests are workin?

**URL:** <https://www.ruby-forum.com/t/how-do-i-check-whether-my-functional-tests-are-workin/179833>\
**Category:** Rails\
**Created:** [December 4, 2009, 10:15pm UTC](https://www.ruby-forum.com/t/how-do-i-check-whether-my-functional-tests-are-workin/179833 "2009-12-04T22:15:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanjanad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c67d28/32.png) [@sanjanad](https://www.ruby-forum.com/u/sanjanad)\
**Post date:** [December 4, 2009, 10:15pm UTC](https://www.ruby-forum.com/t/how-do-i-check-whether-my-functional-tests-are-workin/179833/1 "2009-12-04T22:15:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sanjanad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c67d28/32.png) [@sanjanad](https://www.ruby-forum.com/u/sanjanad)\
**Post date:** [December 7, 2009, 8:08pm UTC](https://www.ruby-forum.com/t/how-do-i-check-whether-my-functional-tests-are-workin/179833/2 "2009-12-07T20:08:23Z")

</div>

Sanjana D. wrote:

> my tests are running with no errors…
> 
> but how do i check whether the functional tests i wrote are working…i  
> need please…

someone pls let me now ☹
