Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The best way is a matter of opinion :) Personally, I like simple and clean. With tools like minitest, <a href="http://watir.com/" rel="noreferrer">Watir</a> and <a href="https://github.com/archiloque/rest-client" rel="noreferrer">rest-client</a>, you can put together a very simple test of both your REST interface as well as testing your web service through actual browsers (all major browsers are supported).</p> <pre><code>#!/usr/bin/ruby # # Requires that you have installed the following gem packages: # json, minitest, watir, watir-webdrive, rest-client # To use Chrome, you need to install chromedriver on your path require 'rubygems' require 'rest-client' require 'json' require 'pp' require 'minitest/autorun' require 'watir' require 'watir-webdriver' class TestReportSystem &lt; MiniTest::Unit::TestCase def setup @browser = Watir::Browser.new :chrome # Defaults to firefox. Can do Safari and IE too. # Log in here..... end def teardown @browser.close end def test_report_lists # For minitest, the method names need to start with test response = RestClient.get 'http://localhost:8080/reporter/reports/getReportList' assert_equal response.code,200 parsed = JSON.parse response.to_str assert_equal parsed.length, 3 # There are 3 reports available on the test server end def test_on_browser @browser.goto 'http://localhost:8080/reporter/exampleReport/simple/genReport?month=Aug&amp;year=2012' assert(@browser.text.include?('Report for Aug 2012')) end end </code></pre> <p>Run the test cases by simply executing the script. There are many other testing systems and REST clients for Ruby which can be put to work in a similar way. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload