Forum: RSpec Newbie testing questions

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ef352bb2a485c38e95f7c6c12ab9face?d=identicon&s=25 Ben D. (bdensmore)
on 2012-06-01 17:46
I recently wrote my first gem and am now in the process of learning how
to write tests for it before I release.

My gem is pretty basic and really just has a few class files with some
methods for using GET  to an API that returns some JSON data.

I'm trying to come up with what I should be testing for, but to be
honest this is where testing has always stumped me.

If I have a class file that looks like the following:

module MyModule

    class MyClass < MyParentClass

      def search(keyword)



The method in this class uses the HTTParty gem and just does a get on
this URL which returns JSON.

Is it a valid use case to test for the keyword argument? I am not sure
if there is any benefit to testing this since it's so very basic. It's a
good experiment for me since I am so new to testing but I really want to
understand what specifically I should be testing.

Any guidance would be greatly appreicated.

699097b12e58a352f40ef1379f9631ad?d=identicon&s=25 Anand K V R. (anandkv_r)
on 2012-09-07 21:14
Hi Friends.

I'm an absolute Tester (little experience on development upto college
level) and had been asked to Test an application developed in Rails. As
our client selected Rspec, I have no other go.

Can anyone help me with a basic program in Rspec how to open GMAIL,
enter username / password , then login.

Thanks in advance ,

This topic is locked and can not be replied to.