Sha256: 0e37d8c5d6efee3a05990d2d22a7813781c85e48b34a20c2ce53a7d02f07916b

Contents?: true

Size: 390 Bytes

Versions: 16

Compression:

Stored size: 390 Bytes

Contents

module ApiTestHelpers
  
  def response_body
    response.body.strip
  end
  
  def response_body_json
    ActiveSupport::JSON.decode(response_body)
  end
  
  def response_body_jsonp(callback)
    jsonp_callback(callback).match(response_body)
  end
  
  def jsonp_callback(callback)
    /\A#{callback}\((.*),\s+\d{3}\)\z/
  end
  
end

RSpec.configure do |c|
  c.include ApiTestHelpers
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
acts_as_api_sequel-0.0.1 spec/support/api_test_helpers.rb
acts_as_api-0.4.2 spec/support/api_test_helpers.rb
acts_as_api-0.4.1 spec/support/api_test_helpers.rb
acts_as_api-0.4 spec/support/api_test_helpers.rb
acts_as_api-0.3.11 spec/support/api_test_helpers.rb
acts_as_api-0.3.10 spec/support/api_test_helpers.rb
acts_as_api-0.3.9 spec/support/api_test_helpers.rb
acts_as_api-0.3.8 spec/support/api_test_helpers.rb
acts_as_api-0.3.7 spec/support/api_test_helpers.rb
acts_as_api-0.3.6 spec/support/api_test_helpers.rb
acts_as_api-0.3.5 spec/support/api_test_helpers.rb
acts_as_api-0.3.4 spec/support/api_test_helpers.rb
acts_as_api-0.3.3 spec/support/api_test_helpers.rb
acts_as_api-0.3.2 spec/support/api_test_helpers.rb
acts_as_api-0.3.1 spec/support/api_test_helpers.rb
acts_as_api-0.3.0 spec/support/api_test_helpers.rb