From 69405329948532ef67d830bfdab5b590d46772fb Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Wed, 6 Feb 2013 23:25:12 -0800 Subject: [PATCH 1/4] Ensure proper content type for cc.xml --- spec/integration/v2/repositories_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/integration/v2/repositories_spec.rb b/spec/integration/v2/repositories_spec.rb index 0c2c928a..95ee74c6 100644 --- a/spec/integration/v2/repositories_spec.rb +++ b/spec/integration/v2/repositories_spec.rb @@ -74,6 +74,7 @@ describe 'Repos' do it 'GET /repos/1/cc.xml' do response = get "repos/#{repo.id}/cc.xml" response.should deliver_cc_xml_for(Repository.by_slug('svenfuchs/minimal').first) + response.content_type.should eq('application/xml;charset=utf-8') end it 'GET /repos/svenfuchs/minimal' do From c57e9cbcc69b58512b2ac027df66ca37f131330d Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Wed, 6 Feb 2013 23:25:42 -0800 Subject: [PATCH 2/4] 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 From 2935050395521f05e9b1e46d6e8075ff8ea2f7b7 Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Wed, 6 Feb 2013 23:28:19 -0800 Subject: [PATCH 3/4] https is better --- lib/travis/api/app/responders/xml.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/travis/api/app/responders/xml.rb b/lib/travis/api/app/responders/xml.rb index 8595a3cd..8d306093 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: File.join("http://", Travis.config.domain, resource.slug), + url: File.join("https://", Travis.config.domain, resource.slug), activity: activity, label: last_build.try(:number), status: status, From 637af8aa44d2392765b2dad6c226b0bf252c8b7e Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Wed, 6 Feb 2013 23:36:31 -0800 Subject: [PATCH 4/4] oh and the spec cares too --- spec/support/matchers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb index fd46184e..798c9709 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?("http://www.example.com/#{repo.slug}") + body.include?('') && body.include?(%(name="#{repo.slug}")) && body.include?("https://www.example.com/#{repo.slug}") end end