2016-10-02 18:30:44 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
require 'rainbow/ext/string'
|
|
|
|
|
|
|
|
describe 'seed production settings', lib: true do
|
2017-01-09 12:19:48 -05:00
|
|
|
include StubENV
|
|
|
|
|
2016-10-02 18:30:44 -04:00
|
|
|
context 'GITLAB_SHARED_RUNNERS_REGISTRATION_TOKEN is set in the environment' do
|
|
|
|
before do
|
2017-01-09 12:19:48 -05:00
|
|
|
stub_env('GITLAB_SHARED_RUNNERS_REGISTRATION_TOKEN', '013456789')
|
2016-10-02 18:30:44 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'writes the token to the database' do
|
|
|
|
load(File.join(__dir__, '../../../db/fixtures/production/010_settings.rb'))
|
|
|
|
expect(ApplicationSetting.current.runners_registration_token).to eq('013456789')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|