Sha256: 8bf3c4cd45b6d7dfcf4a101f3111902e228602bc39ec497217b9271f653f0415

Contents?: true

Size: 675 Bytes

Versions: 1

Compression:

Stored size: 675 Bytes

Contents

require 'spec_helper'
require File.join(File.dirname(__FILE__), '../../', 'examples/echo')

describe Echo do
  include Goliath::TestHelper

  let(:err) { Proc.new { fail "API request failed" } }

  it 'returns the echo param' do
    with_api(Echo) do
      get_request({:query => {:echo => 'test'}}, err) do |c|
        b = Yajl::Parser.parse(c.response)
        b['response'].should == 'test'
      end
    end
  end

  it 'returns error without echo' do
    with_api(Echo) do
      get_request({}, err) do |c|
        b = Yajl::Parser.parse(c.response)
        b['error'].should_not be_nil
        b['error'].should == 'Echo identifier missing'
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
goliath-0.9.0 spec/integration/echo_spec.rb