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
0
Merge Requests
0
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
iv
gitlab-ce
Commits
6f15356a
Commit
6f15356a
authored
Nov 06, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests to release notes feature
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
cb8b9c3f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
7 deletions
+50
-7
app/views/projects/tags/show.html.haml
app/views/projects/tags/show.html.haml
+3
-3
features/project/commits/tags.feature
features/project/commits/tags.feature
+12
-0
features/steps/project/commits/tags.rb
features/steps/project/commits/tags.rb
+20
-0
spec/factories/releases.rb
spec/factories/releases.rb
+3
-3
spec/models/release_spec.rb
spec/models/release_spec.rb
+12
-1
No files found.
app/views/projects/tags/show.html.haml
View file @
6f15356a
...
...
@@ -4,11 +4,11 @@
.gray-content-block
.pull-right
=
link_to
edit_namespace_project_tag_release_path
(
@project
.
namespace
,
@project
,
@tag
.
name
),
class:
'btn-grouped btn'
do
=
link_to
edit_namespace_project_tag_release_path
(
@project
.
namespace
,
@project
,
@tag
.
name
),
class:
'btn-grouped btn'
,
title:
'Edit release notes'
do
=
icon
(
"pencil"
)
=
link_to
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
@tag
.
name
),
class:
'btn btn-grouped'
do
=
link_to
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
@tag
.
name
),
class:
'btn btn-grouped'
,
title:
'Browse source code'
do
=
icon
(
'files-o'
)
=
link_to
namespace_project_commits_path
(
@project
.
namespace
,
@project
,
@tag
.
name
),
class:
'btn btn-grouped'
do
=
link_to
namespace_project_commits_path
(
@project
.
namespace
,
@project
,
@tag
.
name
),
class:
'btn btn-grouped'
,
title:
'Browse commits'
do
=
icon
(
'history'
)
-
if
can?
current_user
,
:download_code
,
@project
=
render
'projects/tags/download'
,
ref:
@tag
.
name
,
project:
@project
...
...
features/project/commits/tags.feature
View file @
6f15356a
...
...
@@ -12,6 +12,12 @@ Feature: Project Commits Tags
And
I submit new tag form
Then
I should see new tag created
Scenario
:
I
create a tag with release notes
Given
I click new tag link
And
I submit new tag form with release notes
Then
I should see new tag created
And
I should see tag release notes
Scenario
:
I
create a tag with invalid name
And
I click new tag link
And
I submit new tag form with invalid name
...
...
@@ -31,3 +37,9 @@ Feature: Project Commits Tags
Given
I visit tag 'v1.1.0' page
Given
I delete tag 'v1.1.0'
Then
I should not see tag 'v1.1.0'
Scenario
:
I
add release notes to the tag
Given
I visit tag 'v1.1.0' page
When
I click edit tag link
And
I fill release notes and submit form
Then
I should see tag release notes
features/steps/project/commits/tags.rb
View file @
6f15356a
...
...
@@ -18,6 +18,18 @@ class Spinach::Features::ProjectCommitsTags < Spinach::FeatureSteps
click_button
'Create tag'
end
step
'I submit new tag form with release notes'
do
fill_in
'tag_name'
,
with:
'v7.0'
fill_in
'ref'
,
with:
'master'
fill_in
'release_description'
,
with:
'Awesome release notes'
click_button
'Create tag'
end
step
'I fill release notes and submit form'
do
fill_in
'release_description'
,
with:
'Awesome release notes'
click_button
'Save changes'
end
step
'I submit new tag form with invalid name'
do
fill_in
'tag_name'
,
with:
'v 1.0'
fill_in
'ref'
,
with:
'master'
...
...
@@ -67,4 +79,12 @@ class Spinach::Features::ProjectCommitsTags < Spinach::FeatureSteps
expect
(
page
).
not_to
have_link
'v1.1.0'
end
end
step
'I click edit tag link'
do
click_link
'Edit release notes'
end
step
'I should see tag release notes'
do
expect
(
page
).
to
have_content
'Awesome release notes'
end
end
spec/factories/releases.rb
View file @
6f15356a
...
...
@@ -2,8 +2,8 @@
FactoryGirl
.
define
do
factory
:release
do
tag
"
MyString
"
description
"
MyText
"
project
_id
1
tag
"
v1.1.0
"
description
"
Awesome release
"
project
end
end
spec/models/release_spec.rb
View file @
6f15356a
require
'rails_helper'
RSpec
.
describe
Release
,
type: :model
do
pending
"add some examples to (or delete)
#{
__FILE__
}
"
let
(
:release
)
{
create
(
:release
)
}
it
{
expect
(
release
).
to
be_valid
}
describe
'associations'
do
it
{
is_expected
.
to
belong_to
(
:project
)
}
end
describe
'validation'
do
it
{
is_expected
.
to
validate_presence_of
(
:project
)
}
it
{
is_expected
.
to
validate_presence_of
(
: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