Use when instead of if, feedback:

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5620/diffs#note_13540211
This commit is contained in:
Lin Jen-Shin 2016-08-03 17:24:59 +08:00
parent 62f115dd25
commit 853b0dffe7

View file

@ -853,7 +853,7 @@ describe Ci::Build, models: true do
describe '#when' do
subject { build.when }
context 'if is undefined' do
context 'when `when` is undefined' do
before do
build.update(when: nil)
build.reload # reload pipeline so that it resets config_processor
@ -864,13 +864,13 @@ describe Ci::Build, models: true do
stub_ci_pipeline_yaml_file(config)
end
context 'if config is not found' do
context 'when config is not found' do
let(:config) { nil }
it { is_expected.to eq('on_success') }
end
context 'if config does not have a questioned job' do
context 'when config does not have a questioned job' do
let(:config) do
YAML.dump({
test_other: {
@ -882,7 +882,7 @@ describe Ci::Build, models: true do
it { is_expected.to eq('on_success') }
end
context 'if config has when' do
context 'when config has when' do
let(:config) do
YAML.dump({
test: {