Forum: RSpec Newbie testing questions

B057a1922dafd7ebf2adcbb92c97d067?d=identicon&s=25 Ben Densmore (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)
         MyModule.get("/someurl/#{keyword}")
      end

    end

end

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.

Thanks,
Ben
D631a33dbf54216ab551a456fc110a62?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 ,

Aishwarya
This topic is locked and can not be replied to.