Sha256: 538227b03f0abe15859e1b5a781aa187e09bff9399bdb0068f03c83fd54af421

Contents?: true

Size: 653 Bytes

Versions: 2

Compression:

Stored size: 653 Bytes

Contents

require "test_helper"

module Cogy
  class JsonResponseTest < ActionDispatch::IntegrationTest
    include Engine.routes.url_helpers

    setup { @routes = Engine.routes }

    def test_json_output_and_default_template
      get "/cogy/cmd/simple_json/george"

      expected = "COG_TEMPLATE: simple_json\n" \
                 "JSON\n" \
                 '{"a":3,"b":4}'

      assert_equal expected, response.body
    end

    def test_custom_template
      get "/cogy/cmd/custom_template/hyu"

      expected = "COG_TEMPLATE: foo\n" \
                 "JSON\n" \
                 '{"a":3}'

      assert_equal expected, response.body
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cogy-0.2.1 test/integration/json_response_test.rb
cogy-0.2.0 test/integration/json_response_test.rb