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
9e619048
Commit
9e619048
authored
Feb 11, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Parse XML instead of HTML in tests for a SVG build badge
parent
debaa813
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
features/project/badges/build.feature
features/project/badges/build.feature
+4
-4
features/steps/project/badges/build.rb
features/steps/project/badges/build.rb
+1
-1
features/steps/shared/builds.rb
features/steps/shared/builds.rb
+2
-2
No files found.
features/project/badges/build.feature
View file @
9e619048
...
@@ -6,17 +6,17 @@ Feature: Project Badges Build
...
@@ -6,17 +6,17 @@ Feature: Project Badges Build
And
project has a recent build
And
project has a recent build
Scenario
:
I
want to see a badge for successfully built project
Scenario
:
I
want to see a badge for successfully built project
Given
recent build is successful
l
Given
recent build is successful
When
I display builds badge for a master branch
When
I display builds badge for a master branch
Then
I should see a build success badge
Then
I should see a build success badge
Scenario
:
I
want to see a badge for project with filed builds
Scenario
:
I
want to see a badge for project with f
a
iled builds
Given
recent build failed
Given
recent build failed
When
I display builds badge for a master branch
When
I display builds badge for a master branch
Then
I should see a build failed badge
Then
I should see a build failed badge
Scenario
:
I
want to see a badge for project with running builds
Scenario
:
I
want to see a badge for project with running builds
Given
recent build is successful
l
Given
recent build is successful
And
project has an
an
other build that is running
And
project has another build that is running
When
I display builds badge for a master branch
When
I display builds badge for a master branch
Then
I should see a build running badge
Then
I should see a build running badge
features/steps/project/badges/build.rb
View file @
9e619048
...
@@ -21,7 +21,7 @@ class Spinach::Features::ProjectBadgesBuild < Spinach::FeatureSteps
...
@@ -21,7 +21,7 @@ class Spinach::Features::ProjectBadgesBuild < Spinach::FeatureSteps
end
end
def
expect_badge
(
status
)
def
expect_badge
(
status
)
svg
=
Nokogiri
::
HT
ML
.
parse
(
page
.
body
)
svg
=
Nokogiri
::
X
ML
.
parse
(
page
.
body
)
expect
(
page
.
response_headers
).
to
include
(
'Content-Type'
=>
'image/svg+xml'
)
expect
(
page
.
response_headers
).
to
include
(
'Content-Type'
=>
'image/svg+xml'
)
expect
(
svg
.
at
(
%Q{text:contains("
#{
status
}
")}
)).
to
be_truthy
expect
(
svg
.
at
(
%Q{text:contains("
#{
status
}
")}
)).
to
be_truthy
end
end
...
...
features/steps/shared/builds.rb
View file @
9e619048
...
@@ -10,7 +10,7 @@ module SharedBuilds
...
@@ -10,7 +10,7 @@ module SharedBuilds
@build
=
create
(
:ci_build
,
commit:
@ci_commit
)
@build
=
create
(
:ci_build
,
commit:
@ci_commit
)
end
end
step
'recent build is successful
l
'
do
step
'recent build is successful'
do
@build
.
update_column
(
:status
,
'success'
)
@build
.
update_column
(
:status
,
'success'
)
end
end
...
@@ -18,7 +18,7 @@ module SharedBuilds
...
@@ -18,7 +18,7 @@ module SharedBuilds
@build
.
update_column
(
:status
,
'failed'
)
@build
.
update_column
(
:status
,
'failed'
)
end
end
step
'project has an
an
other build that is running'
do
step
'project has another build that is running'
do
create
(
:ci_build
,
commit:
@ci_commit
,
name:
'second build'
,
status:
'running'
)
create
(
:ci_build
,
commit:
@ci_commit
,
name:
'second build'
,
status:
'running'
)
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