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

Merge branch '43603-ci-lint-support' into 'master'

Resolve "/ci/lint should support include keyword in config file"

Closes #43603

See merge request gitlab-org/gitlab-ce!17729
parents 949d1b37 bab17600
No related branches found
No related tags found
No related merge requests found
require 'spec_helper'
 
describe 'CI Lint', :js do
let(:project) { create(:project, :repository) }
let(:user) { create(:user) }
before do
sign_in(create(:user))
project.add_developer(user)
sign_in(user)
 
visit ci_lint_path
visit project_ci_lint_path(project)
find('#ci-editor')
execute_script("ace.edit('ci-editor').setValue(#{yaml_content.to_json});")
 
Loading
Loading
require 'spec_helper'
 
describe 'ci/lints/show' do
describe 'projects/ci/lints/show' do
include Devise::Test::ControllerHelpers
let(:project) { create(:project, :repository) }
let(:config_processor) { Gitlab::Ci::YamlProcessor.new(YAML.dump(content)) }
 
describe 'XSS protection' do
let(:config_processor) { Gitlab::Ci::YamlProcessor.new(YAML.dump(content)) }
before do
assign(:project, project)
assign(:status, true)
assign(:builds, config_processor.builds)
assign(:stages, config_processor.stages)
Loading
Loading
@@ -48,22 +49,21 @@ describe 'ci/lints/show' do
end
end
 
let(:content) do
{
build_template: {
script: './build.sh',
tags: ['dotnet'],
only: ['test@dude/repo'],
except: ['deploy'],
environment: 'testing'
context 'when the content is valid' do
let(:content) do
{
build_template: {
script: './build.sh',
tags: ['dotnet'],
only: ['test@dude/repo'],
except: ['deploy'],
environment: 'testing'
}
}
}
end
let(:config_processor) { Gitlab::Ci::YamlProcessor.new(YAML.dump(content)) }
end
 
context 'when the content is valid' do
before do
assign(:project, project)
assign(:status, true)
assign(:builds, config_processor.builds)
assign(:stages, config_processor.stages)
Loading
Loading
@@ -83,6 +83,7 @@ describe 'ci/lints/show' do
 
context 'when the content is invalid' do
before do
assign(:project, project)
assign(:status, false)
assign(:error, 'Undefined error')
end
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