Merge branch 'pr/46'

This commit is contained in:
Piotr Sarnacki 2013-03-25 16:40:08 +01:00
commit 15dd13ba02
4 changed files with 4 additions and 2 deletions

View File

@ -34,7 +34,7 @@ module Travis::Api::App::Responders
def data def data
{ {
name: resource.slug, name: resource.slug,
url: [Travis.config.domain, resource.slug].join('/'), url: File.join("https://", Travis.config.domain, resource.slug),
activity: activity, activity: activity,
label: last_build.try(:number), label: last_build.try(:number),
status: status, status: status,

View File

@ -74,6 +74,7 @@ describe 'Repos' do
it 'GET /repos/1/cc.xml' do it 'GET /repos/1/cc.xml' do
response = get "repos/#{repo.id}/cc.xml" response = get "repos/#{repo.id}/cc.xml"
response.should deliver_cc_xml_for(Repository.by_slug('svenfuchs/minimal').first) response.should deliver_cc_xml_for(Repository.by_slug('svenfuchs/minimal').first)
response.content_type.should eq('application/xml;charset=utf-8')
end end
it 'GET /repos/svenfuchs/minimal' do it 'GET /repos/svenfuchs/minimal' do

View File

@ -14,6 +14,7 @@ require 'support/matchers'
Travis.logger = Logger.new(StringIO.new) Travis.logger = Logger.new(StringIO.new)
Travis::Api::App.setup Travis::Api::App.setup
Travis.config.domain = "www.example.com"
module TestHelpers module TestHelpers
include Sinatra::TestHelpers include Sinatra::TestHelpers

View File

@ -62,7 +62,7 @@ RSpec::Matchers.define :deliver_cc_xml_for do |repo|
"expected #{body} to be a valid cc.xml" "expected #{body} to be a valid cc.xml"
end end
body.include?('<Projects>') && body.include?(%(name="#{repo.slug}")) body.include?('<Projects>') && body.include?(%(name="#{repo.slug}")) && body.include?("https://www.example.com/#{repo.slug}")
end end
end end