Show Gemfile on jobs matrix
This commit is contained in:
parent
54cd5079a8
commit
f02d683892
|
@ -15,7 +15,18 @@ JobsItemComponent = Ember.Component.extend
|
||||||
if version = config[key]
|
if version = config[key]
|
||||||
output.push(languageName + ': ' + version)
|
output.push(languageName + ': ' + version)
|
||||||
|
|
||||||
|
gemfile = @get('job.config.gemfile')
|
||||||
|
if gemfile && @get('job.config.env')
|
||||||
|
output.push "Gemfile: #{gemfile}"
|
||||||
|
|
||||||
output.join(' ')
|
output.join(' ')
|
||||||
).property('job.config')
|
).property('job.config')
|
||||||
|
|
||||||
|
environment: (->
|
||||||
|
if env = @get('job.config.env')
|
||||||
|
env
|
||||||
|
else if gemfile = @get('job.config.gemfile')
|
||||||
|
"Gemfile: #{gemfile}"
|
||||||
|
).property('job.config.env', 'job.config.gemfile')
|
||||||
|
|
||||||
`export default JobsItemComponent`
|
`export default JobsItemComponent`
|
||||||
|
|
|
@ -25,10 +25,10 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<div class="job-anchor jobs-item">
|
<div class="job-anchor jobs-item">
|
||||||
{{#if job.config.env}}
|
{{#if environment}}
|
||||||
<p class="job-env jobs-item build-env">
|
<p class="job-env jobs-item build-env">
|
||||||
<span class="icon icon--env"></span>
|
<span class="icon icon--env"></span>
|
||||||
{{job.config.env}}
|
{{environment}}
|
||||||
</p>
|
</p>
|
||||||
{{else}}
|
{{else}}
|
||||||
<p class="job-env jobs-item build-env is-empty">
|
<p class="job-env jobs-item build-env is-empty">
|
||||||
|
|
|
@ -37,3 +37,40 @@ test 'ouputs info on not set properties', ->
|
||||||
|
|
||||||
ok component.$('.job-env').text().match(/no environment variables set/), 'a message for no env vars should be displayed'
|
ok component.$('.job-env').text().match(/no environment variables set/), 'a message for no env vars should be displayed'
|
||||||
ok component.$('.job-lang').text().match(/no language set/), 'a message about no language being set should be displayed'
|
ok component.$('.job-lang').text().match(/no language set/), 'a message about no language being set should be displayed'
|
||||||
|
|
||||||
|
test 'when env is not set, gemfile is displayed in the env section', ->
|
||||||
|
attributes = {
|
||||||
|
id: 10
|
||||||
|
state: 'passed'
|
||||||
|
number: '2'
|
||||||
|
config: {
|
||||||
|
rvm: '2.1.2'
|
||||||
|
gemfile: 'foo/Gemfile'
|
||||||
|
},
|
||||||
|
duration: 100
|
||||||
|
}
|
||||||
|
job = Ember.Object.create(attributes)
|
||||||
|
component = @subject(job: job)
|
||||||
|
@append()
|
||||||
|
|
||||||
|
equal component.$('.job-lang').text().trim(), 'Ruby: 2.1.2', 'langauges list should be displayed'
|
||||||
|
equal component.$('.job-env').text().trim(), 'Gemfile: foo/Gemfile', 'env should be displayed'
|
||||||
|
|
||||||
|
test 'when env is set, gemfile is displayed in the language section', ->
|
||||||
|
attributes = {
|
||||||
|
id: 10
|
||||||
|
state: 'passed'
|
||||||
|
number: '2'
|
||||||
|
config: {
|
||||||
|
rvm: '2.1.2'
|
||||||
|
gemfile: 'foo/Gemfile'
|
||||||
|
env: 'FOO=bar'
|
||||||
|
},
|
||||||
|
duration: 100
|
||||||
|
}
|
||||||
|
job = Ember.Object.create(attributes)
|
||||||
|
component = @subject(job: job)
|
||||||
|
@append()
|
||||||
|
|
||||||
|
equal component.$('.job-lang').text().trim(), 'Ruby: 2.1.2 Gemfile: foo/Gemfile', 'Gemfile should be displayed in languages section'
|
||||||
|
equal component.$('.job-env').text().trim(), 'FOO=bar', 'env should be displayed'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user