diff options
author | Katarzyna Kobierska <kkobierska@gmail.com> | 2016-07-21 12:23:21 +0300 |
---|---|---|
committer | Katarzyna Kobierska <kkobierska@gmail.com> | 2016-07-26 12:19:40 +0300 |
commit | 79c29a67caa56fdff888221a71a446a3c4e7ac5e (patch) | |
tree | 91f3cc9b767d56767b626247879fd9ef37da9d71 /spec/views | |
parent | 4f2ef9a6e5e6997ef4bc70e435b9d0011b46f509 (diff) |
Add test for multiple trigger variables view
Diffstat (limited to 'spec/views')
-rw-r--r-- | spec/views/projects/builds/show.html.haml_spec.rb | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/spec/views/projects/builds/show.html.haml_spec.rb b/spec/views/projects/builds/show.html.haml_spec.rb index 42220a20c75..bc433a15a7c 100644 --- a/spec/views/projects/builds/show.html.haml_spec.rb +++ b/spec/views/projects/builds/show.html.haml_spec.rb @@ -44,9 +44,26 @@ describe 'projects/builds/show' do it 'shows commit title and not show commit message' do render - + expect(rendered).to have_css('p.build-light-text.append-bottom-0', text: /\A\n#{Regexp.escape(commit_title)}\n\Z/) end end + + describe 'shows trigger variables in sidebar' do + let(:trigger) { create(:ci_trigger, project: project) } + let(:trigger_request) { create(:ci_trigger_request_with_variables, pipeline: pipeline, trigger: trigger) } + + before do + build.trigger_request = trigger_request + end + + it 'shows trigger variables in separate lines' do + trigger_request.update_attributes(variables: { TRIGGER_KEY: 'TRIGGER_VALUE', TRIGGER_KEY_1: 'TRIGGER_VALUE_1' }) + render + + expect(rendered).to have_css('code', text: /\A#{Regexp.escape('TRIGGER_KEY=TRIGGER_VALUE')}\Z/) + expect(rendered).to have_css('code', text: /\A#{Regexp.escape('TRIGGER_KEY_1=TRIGGER_VALUE_1')}\Z/) + end + end end |