File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ def service_name
7777 end
7878
7979 def credentials_of_all_repos
80- CF ::App ::Credentials . find_all_by_service_label ( service_name )
80+ @credentials ||= CF ::App ::Credentials . new ( { 'VCAP_SERVICES' => vcap_services } )
81+ @credentials . find_all_by_service_label ( service_name )
8182 end
82- end
83+ end
Original file line number Diff line number Diff line change 55 before do
66 ensure_env_vars_exist
77
8- @vcap_services_value = <<JSON
8+ @vcap_services_value = <<~ JSON
99 {
1010 "github-repo": [
1111 {
1616 "name": "#{ repo_name } ",
1717 "uri": "#{ repo_uri } ",
1818 "ssh_url": "#{ repo_ssh_url } ",
19- "private_key": " #{ repo_private_key } "
19+ "private_key": #{ repo_private_key . to_json }
2020 }
2121 }
2222 ]
2323 }
24- JSON
24+ JSON
25+
26+ @vcap_application_value = <<~JSON
27+ {
28+ "application_name": "#{ File . basename ( __FILE__ , '.rb' ) } "
29+ }
30+ JSON
2531
2632 ServiceConsumerApp . any_instance . stubs ( :vcap_services ) . returns ( @vcap_services_value )
33+ ServiceConsumerApp . any_instance . stubs ( :vcap_application ) . returns ( @vcap_application_value )
2734
2835 visit "/"
2936 end
@@ -69,6 +76,7 @@ def repo_name
6976end
7077
7178def repo_private_key
79+ # the corresponding public key must be present as a deploy key in "#{github_username}/#{repo_name}"
7280 ENV [ "GITHUB_REPO_PRIVATE_KEY" ]
7381end
7482
@@ -86,4 +94,4 @@ def repo_fullname
8694
8795def github_client
8896 ::Octokit ::Client . new ( access_token : github_access_token )
89- end
97+ end
You can’t perform that action at this time.
0 commit comments