elpassion/grape-cli

View on GitHub
lib/grape_cli/templates/minitest/requests/hello_world_test.rb.tt

Summary

Maintainability
Test Coverage
require 'test_helper'

class HelloWorldTest < MiniTest::Test
  include Rack::Test::Methods

  def app
    <%= config[:class_name] %>::API
  end

  def test_api_get_hello_world
    get '/api/hello_world'
    assert last_response.ok?
    assert_equal 'hello world', JSON.parse(last_response.body)['message']
  end
end