From c57e9cbcc69b58512b2ac027df66ca37f131330d Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Wed, 6 Feb 2013 23:25:42 -0800 Subject: [PATCH] valid URLs in cc.xml Project webUrl --- lib/travis/api/app/responders/xml.rb | 2 +- spec/spec_helper.rb | 1 + spec/support/matchers.rb | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/travis/api/app/responders/xml.rb b/lib/travis/api/app/responders/xml.rb index 9fa43fcf..8595a3cd 100644 --- a/lib/travis/api/app/responders/xml.rb +++ b/lib/travis/api/app/responders/xml.rb @@ -28,7 +28,7 @@ module Travis::Api::App::Responders def data { name: resource.slug, - url: [Travis.config.domain, resource.slug].join('/'), + url: File.join("http://", Travis.config.domain, resource.slug), activity: activity, label: last_build.try(:number), status: status, diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 33a828a1..2384d178 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -14,6 +14,7 @@ require 'support/matchers' Travis.logger = Logger.new(StringIO.new) Travis::Api::App.setup +Travis.config.domain = "www.example.com" module TestHelpers include Sinatra::TestHelpers diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb index 3152322a..fd46184e 100644 --- a/spec/support/matchers.rb +++ b/spec/support/matchers.rb @@ -62,7 +62,7 @@ RSpec::Matchers.define :deliver_cc_xml_for do |repo| "expected #{body} to be a valid cc.xml" end - body.include?('') && body.include?(%(name="#{repo.slug}")) + body.include?('') && body.include?(%(name="#{repo.slug}")) && body.include?("http://www.example.com/#{repo.slug}") end end