-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move VCR credentials into secrets.yml
- Loading branch information
Showing
3 changed files
with
39 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FactoryGirl.define do | ||
factory :ems_google_with_vcr_authentication, :parent => :ems_google do | ||
zone do | ||
_guid, _server, zone = EvmSpecHelper.create_guid_miq_server_zone | ||
zone | ||
end | ||
|
||
after(:create) do |ems| | ||
project = Rails.application.secrets.google.try(:[], 'project') || 'GOOGLE_PROJECT' | ||
service_account = Rails.application.secrets.google.try(:[], 'service_account') || 'GOOGLE_SERVICE_ACCOUNT' | ||
|
||
ems.authentications << FactoryGirl.create( | ||
:authentication, | ||
:type => "AuthToken", | ||
:auth_key => service_account, | ||
:userid => "_" | ||
) | ||
ems.update_attributes(:project => project) | ||
end | ||
end | ||
end |
14 changes: 1 addition & 13 deletions
14
spec/models/manageiq/providers/google/cloud_manager/refresher_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,6 @@ | ||
describe ManageIQ::Providers::Google::CloudManager::Refresher do | ||
before(:each) do | ||
_guid, _server, zone = EvmSpecHelper.create_guid_miq_server_zone | ||
@google_json_key = "{\n \"type\": \"service_account\",\n \"project_id\": \"civil-tube-113314\",\n \"private_key_id\": \"bd99fda9d4a1e62f8371b7cd92ffcc6bb21ee453\",\n \"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCR2KaVdHB3sMkm\\n8v8KZCPuKMvbUZ4oswT2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MFaZDMOfgj2ciTiEB7cRksqkky3xbGyzkaAz\\nZeKokWKFq14i4VoBP0zDbXsFqq2ByxWTFtvEZBEXf6XnKZ5LEtFoMwXa6DpYCjs5\\nXMpsYL4shn58WJpTneo7FZV/HDSwO5thw3duFc38bCcLFhaRKM3QRbV5AoGBAIco\\nwmkNYdMCJqqu/y/EBwayhPoP2HPlE1Gaxpt6v/sQClfOgr4ln4vTBRuu4IvPK+ju\\nltzVxpnWzdK9wGQpMONUv9z379utM5HEZSC3QVKlGWwop0bBvshCqPG43RL9pdr1\\nVpjHBc57W3oYLsWQ0NP/GhTIMRoCPdw+4B7VWWOhAoGAYEdx3cnDpPOTH1179GTv\\ny/q1LXvp8nP50HZ1Yc+wAOnifXBKhSTpjDqgru5OiGT7rggzyK0ui3nyfbwM5AH7\\nyQXmt8q0Nnzo8GdL+YKTfGbnmSwDH0SotEeofwruPuxOr7ows6joo283NOugudsx\\nUAa/tB/piHG/VYQ6dxb8zsg=\\n-----END PRIVATE KEY-----\\n\",\n \"client_email\": \"[email protected]\",\n \"client_id\": \"102455136987689387132\",\n \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n \"token_uri\": \"https://accounts.google.com/o/oauth2/token\",\n \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\n \"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/199203428544-compute%40developer.gserviceaccount.com\"\n}\n" | ||
@ems = FactoryGirl.create(:ems_google, :zone => zone) | ||
@ems.authentications << FactoryGirl.create(:authentication, :userid => "_", :auth_key => @google_json_key) | ||
@ems.update_attributes(:project => "civil-tube-113314") | ||
|
||
# A true thread may fail the test with VCR | ||
allow(Thread).to receive(:new) do |*args, &block| | ||
block.call(*args) | ||
Class.new do | ||
def join; end | ||
end.new | ||
end | ||
@ems = FactoryGirl.create(:ems_google_with_vcr_authentication) | ||
end | ||
|
||
it "will perform a full refresh" do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters