summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorKatarzyna Kobierska <kkobierska@gmail.com>2016-09-20 15:19:55 +0200
committerKatarzyna Kobierska <kkobierska@gmail.com>2016-09-30 12:22:55 +0200
commit7dfb204ef9d343888e2fd8327c5a5348b98a76ce (patch)
tree35d1760ca664f9e9a029516eaef7b459a4b7aa84 /spec
parente26953bc4bc7c9522258f201b175c60fd6c0b2a2 (diff)
downloadgitlab-ce-7dfb204ef9d343888e2fd8327c5a5348b98a76ce.tar.gz
Expose jobs to view
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/ci/gitlab_ci_yaml_processor_spec.rb28
-rw-r--r--spec/views/ci/lints/show.html.haml_spec.rb16
2 files changed, 23 insertions, 21 deletions
diff --git a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
index 317259f0c27..6dedd25e9d3 100644
--- a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+++ b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
@@ -26,9 +26,7 @@ module Ci
allow_failure: false,
when: "on_success",
environment: nil,
- yaml_variables: [],
- only: nil,
- except: nil
+ yaml_variables: []
})
end
@@ -445,9 +443,7 @@ module Ci
allow_failure: false,
when: "on_success",
environment: nil,
- yaml_variables: [],
- only: nil,
- except: nil
+ yaml_variables: []
})
end
@@ -475,9 +471,7 @@ module Ci
allow_failure: false,
when: "on_success",
environment: nil,
- yaml_variables: [],
- only: nil,
- except: nil
+ yaml_variables: []
})
end
end
@@ -722,9 +716,7 @@ module Ci
when: "on_success",
allow_failure: false,
environment: nil,
- yaml_variables: [],
- only: nil,
- except: nil
+ yaml_variables: []
})
end
@@ -867,9 +859,7 @@ module Ci
when: "on_success",
allow_failure: false,
environment: nil,
- yaml_variables: [],
- only: nil,
- except: nil
+ yaml_variables: []
})
end
end
@@ -914,9 +904,7 @@ module Ci
when: "on_success",
allow_failure: false,
environment: nil,
- yaml_variables: [],
- only: nil,
- except: nil
+ yaml_variables: []
})
expect(subject.second).to eq({
stage: "build",
@@ -928,9 +916,7 @@ module Ci
when: "on_success",
allow_failure: false,
environment: nil,
- yaml_variables: [],
- only: nil,
- except: nil
+ yaml_variables: []
})
end
end
diff --git a/spec/views/ci/lints/show.html.haml_spec.rb b/spec/views/ci/lints/show.html.haml_spec.rb
index be41134d12a..620fb0e4821 100644
--- a/spec/views/ci/lints/show.html.haml_spec.rb
+++ b/spec/views/ci/lints/show.html.haml_spec.rb
@@ -20,6 +20,7 @@ describe 'ci/lints/show' do
assign(:status, true)
assign(:builds, config_processor.builds)
assign(:stages, config_processor.stages)
+ assign(:jobs, config_processor.jobs)
end
it 'shows the correct values' do
@@ -32,4 +33,19 @@ describe 'ci/lints/show' do
expect(rendered).to have_content('When: on_success')
end
end
+
+ context 'when the content is invalid' do
+ before do
+ assign(:status, false)
+ assign(:error, 'Undefined error')
+ end
+
+ it 'shows error message' do
+ render
+
+ expect(rendered).to have_content('Status: syntax is incorrec')
+ expect(rendered).to have_content('Error: Undefined error')
+ expect(rendered).not_to have_content('Tag list:')
+ end
+ end
end