travis-api/spec/unit/endpoint_spec.rb
2012-10-02 16:39:38 +02:00

19 lines
416 B
Ruby

require 'spec_helper'
describe Travis::Api::App::Endpoint do
class MyEndpoint < Travis::Api::App::Endpoint
set :prefix, '/my_endpoint'
get('/') { 'ok' }
end
it 'sets up endpoints automatically under given prefix' do
get('/my_endpoint/').should be_ok
body.should == "ok"
end
it 'does not require a trailing slash' do
get('/my_endpoint').should be_ok
body.should == "ok"
end
end