Fix tests and rubocop offense
This commit is contained in:
parent
ef10f4c531
commit
7f01167681
|
@ -188,7 +188,7 @@ module Ci
|
|||
variables += project.secret_variables
|
||||
variables += project.protected_variables if
|
||||
ProtectedBranch.protected?(project, ref) ||
|
||||
ProtectedTag.protected?(project, ref)
|
||||
ProtectedTag.protected?(project, ref)
|
||||
variables += trigger_request.user_variables if trigger_request
|
||||
variables
|
||||
end
|
||||
|
|
|
@ -136,10 +136,10 @@ describe 'Project variables', js: true do
|
|||
end
|
||||
|
||||
expect(page).to have_content('Update variable')
|
||||
check('Protected')
|
||||
uncheck('Protected')
|
||||
click_button('Save variable')
|
||||
|
||||
expect(page).to have_content('Variable was successfully updated.')
|
||||
expect(project.variables.first).not_to be_protected
|
||||
expect(project.reload.variables.first).not_to be_protected
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Gitlab::Utils, lib: true do
|
||||
delegate :to_boolean, to: :described_class
|
||||
delegate :to_boolean, :boolean_to_yes_no, to: :described_class
|
||||
|
||||
describe '.to_boolean' do
|
||||
it 'accepts booleans' do
|
||||
|
@ -29,7 +31,9 @@ describe Gitlab::Utils, lib: true do
|
|||
expect(to_boolean('')).to be_nil
|
||||
expect(to_boolean(nil)).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
describe '.boolean_to_yes_no' do
|
||||
it 'converts booleans to Yes or No' do
|
||||
expect(boolean_to_yes_no(true)).to eq('Yes')
|
||||
expect(boolean_to_yes_no(false)).to eq('No')
|
||||
|
|
Loading…
Reference in New Issue