Skip to content
Snippets Groups Projects
Commit 94190461 authored by Kamil Trzcińśki's avatar Kamil Trzcińśki
Browse files

Fix specs

parent 0aa6061d
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -187,7 +187,7 @@ module Ci
end
 
if job[:when] && !job[:when].in?(%w(on_success on_failure always))
raise ValidationError, "#{name}: when should be on_success, on_failure or always"
raise ValidationError, "#{name}: when parameter should be on_success, on_failure or always"
end
end
 
Loading
Loading
Loading
Loading
@@ -24,7 +24,8 @@ module Ci
commands: "pwd\nrspec",
tag_list: [],
options: {},
allow_failure: false
allow_failure: false,
when: "on_success"
})
end
 
Loading
Loading
@@ -330,7 +331,7 @@ module Ci
end
 
it "returns errors if job when is not on_success, on_failure or always" do
config = YAML.dump({ rspec: { script: "test", when: false } })
config = YAML.dump({ rspec: { script: "test", when: 1 } })
expect do
GitlabCiYamlProcessor.new(config)
end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: when parameter should be on_success, on_failure or always")
Loading
Loading
Loading
Loading
@@ -248,7 +248,7 @@ describe Ci::Commit do
end
 
context 'properly creates builds "when" is defined' do
let(:yaml) {
let(:yaml) do
{
stages: ["build", "test", "test_failure", "deploy", "cleanup"],
build: {
Loading
Loading
@@ -274,7 +274,7 @@ describe Ci::Commit do
when: "always",
}
}
}
end
 
before do
stub_ci_commit_yaml_file(YAML.dump(yaml))
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment