Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0bf14cb0
Commit
0bf14cb0
authored
Nov 18, 2016
by
winniehell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create dynamic fixture for build_spec (!7589)
parent
c52f3d1c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
72 deletions
+38
-72
changelogs/unreleased/create-dynamic-fixture-for-build_spec.yml
...logs/unreleased/create-dynamic-fixture-for-build_spec.yml
+4
-0
spec/javascripts/build_spec.js.es6
spec/javascripts/build_spec.js.es6
+2
-10
spec/javascripts/fixtures/build.html.haml
spec/javascripts/fixtures/build.html.haml
+0
-62
spec/javascripts/fixtures/builds.rb
spec/javascripts/fixtures/builds.rb
+32
-0
No files found.
changelogs/unreleased/create-dynamic-fixture-for-build_spec.yml
0 → 100644
View file @
0bf14cb0
---
title
:
Create dynamic fixture for build_spec
merge_request
:
7589
author
:
winniehell
spec/javascripts/build_spec.js.es6
View file @
0bf14cb0
...
@@ -11,10 +11,10 @@
...
@@ -11,10 +11,10 @@
(() => {
(() => {
describe('Build', () => {
describe('Build', () => {
fixture.preload('build
.html
');
fixture.preload('build
s/build-with-artifacts.html.raw
');
beforeEach(function () {
beforeEach(function () {
fixture.load('build
.html
');
fixture.load('build
s/build-with-artifacts.html.raw
');
spyOn($, 'ajax');
spyOn($, 'ajax');
});
});
...
@@ -28,15 +28,7 @@
...
@@ -28,15 +28,7 @@
});
});
describe('setup', function () {
describe('setup', function () {
const removeDate = new Date();
removeDate.setUTCFullYear(removeDate.getUTCFullYear() + 1);
// give the test three days to run
removeDate.setTime(removeDate.getTime() + (3 * 24 * 60 * 60 * 1000));
beforeEach(function () {
beforeEach(function () {
const removeDateElement = document.querySelector('.js-artifacts-remove');
removeDateElement.innerText = removeDate.toString();
this.build = new Build();
this.build = new Build();
});
});
...
...
spec/javascripts/fixtures/build.html.haml
deleted
100644 → 0
View file @
c52f3d1c
.build-page
.prepend-top-default
.autoscroll-container
%button
.btn.btn-success.btn-sm
#autoscroll-button
{
:type
=>
"button"
,
:data
=>
{
:state
=>
'disabled'
}}
enable autoscroll
#js-build-scroll
.scroll-controls
%a
.btn
{
href:
'#build-trace'
}
%i
.fa.fa-angle-up
%a
.btn
{
href:
'#down-build-trace'
}
%i
.fa.fa-angle-down
%pre
.build-trace
#build-trace
%code
.bash.js-build-output
%i
.fa.fa-refresh.fa-spin.js-build-refresh
%aside
.right-sidebar.right-sidebar-expanded.build-sidebar.js-build-sidebar
.block.build-sidebar-header.visible-xs-block.visible-sm-block.append-bottom-default
Build
%strong
#1
%a
.gutter-toggle.pull-right.js-sidebar-build-toggle
{
href:
"#"
}
%i
.fa.fa-angle-double-right
.blocks-container
.dropdown.build-dropdown
.title
Stage
%button
.dropdown-menu-toggle
{
type:
'button'
,
'data-toggle'
=>
'dropdown'
}
%span
.stage-selection
More
%i
.fa.fa-caret-down
%ul
.dropdown-menu
%li
%a
.stage-item
build
%li
%a
.stage-item
test
%li
%a
.stage-item
deploy
.builds-container
.build-job
{
data:
{
stage:
'build'
}}
%a
{
href:
'http://example.com/root/test-build/builds/1'
}
%i
.fa.fa-check
%i
.fa.fa-check-circle-o
%span
Setup
.build-job
{
data:
{
stage:
'test'
}}
%a
{
href:
'http://example.com/root/test-build/builds/2'
}
%i
.fa.fa-check
%i
.fa.fa-check-circle-o
%span
Tests
.build-job
{
data:
{
stage:
'deploy'
}}
%a
{
href:
'http://example.com/root/test-build/builds/3'
}
%i
.fa.fa-check
%i
.fa.fa-check-circle-o
%span
Deploy
.js-build-options
{
data:
{
page_url:
'http://example.com/root/test-build/builds/2'
,
build_url:
'http://example.com/root/test-build/builds/2.json'
,
build_status:
'passed'
,
build_stage:
'test'
,
log_state:
'buildstate'
}}
%p
.build-detail-row
The artifacts will be removed in
%span
.js-artifacts-remove
2016-12-19 09:02:12 UTC
spec/javascripts/fixtures/builds.rb
0 → 100644
View file @
0bf14cb0
require
'spec_helper'
describe
Projects
::
BuildsController
,
'(JavaScript fixtures)'
,
type: :controller
do
include
JavaScriptFixturesHelpers
let
(
:admin
)
{
create
(
:admin
)
}
let
(
:project
)
{
create
(
:project_empty_repo
)
}
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
,
project:
project
)
}
let!
(
:build_with_artifacts
)
{
create
(
:ci_build
,
:success
,
:artifacts
,
:trace
,
pipeline:
pipeline
,
stage:
'test'
,
artifacts_expire_at:
Time
.
now
+
18
.
months
)
}
let!
(
:failed_build
)
{
create
(
:ci_build
,
:failed
,
pipeline:
pipeline
,
stage:
'build'
)
}
let!
(
:pending_build
)
{
create
(
:ci_build
,
:pending
,
pipeline:
pipeline
,
stage:
'deploy'
)
}
render_views
before
(
:all
)
do
clean_frontend_fixtures
(
'builds/'
)
end
before
(
:each
)
do
sign_in
(
admin
)
end
it
'builds/build-with-artifacts.html.raw'
do
|
example
|
get
:show
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
id:
build_with_artifacts
.
to_param
expect
(
response
).
to
be_success
store_frontend_fixture
(
response
,
example
.
description
)
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment