Sha256: da9ef64e3a7abce13e4f7d15a9eed8c1aa512d36b777608f3b43bcd07949f56e

Contents?: true

Size: 726 Bytes

Versions: 3

Compression:

Stored size: 726 Bytes

Contents

require_relative 'helper'

describe 'GET /' do
  user = "deployer"
  pass = "Deploy1T"
  it 'should request authentication' do
    get '/'
    last_response.status.must_equal 401
  end
  it 'should respond with authentication' do
    authorize user, pass
    get '/'
    assert last_response.ok?
    assert last_response.body.must_match "I'm running. Nice, isn't it?"
  end
  # payload has a known repository and branch name (aka configured)
  it 'should respond with 500 - webhook payload of type unknowntype not configured' do
    authorize user, pass
    post '/payload/unknowntype', 'payload' => 'empty'
    assert_equal 400, last_response.status
    assert last_response.body.must_match "Payload type unknown"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
webhookd-0.0.9 test/test_basics.rb
webhookd-0.0.8 test/test_basics.rb
webhookd-0.0.7 test/test_basics.rb