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
Léo-Paul Géneau
gitlab-ce
Commits
e6d5a6a3
Commit
e6d5a6a3
authored
Sep 17, 2017
by
Vitaliy @blackst0ne Klachkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace the 'project/archived.feature' spinach test with an rspec analog
parent
64664b64
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
66 deletions
+48
-66
changelogs/unreleased/replace_project_archived-feature.yml
changelogs/unreleased/replace_project_archived-feature.yml
+5
-0
features/project/archived.feature
features/project/archived.feature
+0
-30
features/steps/project/archived.rb
features/steps/project/archived.rb
+0
-36
spec/features/projects/user_archives_project_spec.rb
spec/features/projects/user_archives_project_spec.rb
+43
-0
No files found.
changelogs/unreleased/replace_project_archived-feature.yml
0 → 100644
View file @
e6d5a6a3
---
title
:
Replace the 'project/archived.feature' spinach test with an rspec analog
merge_request
:
14322
author
:
Vitaliy @blackst0ne Klachkov
type
:
other
features/project/archived.feature
deleted
100644 → 0
View file @
64664b64
Feature
:
Project Archived
Background
:
Given
I sign in as a user
And
I own project
"Shop"
And
I own project
"Forum"
Scenario
:
I
should not see archived on project page of not-archive project
And
project
"Forum"
is archived
And
I visit project
"Shop"
page
Then
I should not see
"Archived"
Scenario
:
I
should see archived on project page of archive project
And
project
"Forum"
is archived
And
I visit project
"Forum"
page
Then
I should see
"Archived"
Scenario
:
I
archive project
When
project
"Shop"
has push event
And
I visit project
"Shop"
page
And
I visit edit project
"Shop"
page
And
I set project archived
Then
I should see
"Archived"
Scenario
:
I
unarchive project
When
project
"Shop"
has push event
And
project
"Shop"
is archived
And
I visit project
"Shop"
page
And
I visit edit project
"Shop"
page
And
I set project unarchived
Then
I should not see
"Archived"
features/steps/project/archived.rb
deleted
100644 → 0
View file @
64664b64
class
Spinach::Features::ProjectArchived
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedProject
include
SharedPaths
When
'project "Forum" is archived'
do
project
=
Project
.
find_by
(
name:
"Forum"
)
project
.
update_attribute
(
:archived
,
true
)
end
When
'project "Shop" is archived'
do
project
=
Project
.
find_by
(
name:
"Shop"
)
project
.
update_attribute
(
:archived
,
true
)
end
When
'I visit project "Forum" page'
do
project
=
Project
.
find_by
(
name:
"Forum"
)
visit
project_path
(
project
)
end
step
'I should not see "Archived"'
do
expect
(
page
).
not_to
have_content
"Archived"
end
step
'I should see "Archived"'
do
expect
(
page
).
to
have_content
"Archived"
end
When
'I set project archived'
do
click_link
"Archive"
end
When
'I set project unarchived'
do
click_link
"Unarchive"
end
end
spec/features/projects/user_archives_project_spec.rb
0 → 100644
View file @
e6d5a6a3
require
'spec_helper'
describe
'User archives a project'
do
let
(
:user
)
{
create
(
:user
)
}
before
do
project
.
add_master
(
user
)
sign_in
(
user
)
end
context
'when a project is archived'
do
let
(
:project
)
{
create
(
:project
,
:archived
,
namespace:
user
.
namespace
)
}
before
do
visit
(
edit_project_path
(
project
))
end
it
'unarchives a project'
do
expect
(
page
).
to
have_content
(
'Unarchive project'
)
click_link
(
'Unarchive'
)
expect
(
page
).
not_to
have_content
(
'Archived project'
)
end
end
context
'when a project is unarchived'
do
let
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
user
.
namespace
)
}
before
do
visit
(
edit_project_path
(
project
))
end
it
'archives a project'
do
expect
(
page
).
to
have_content
(
'Archive project'
)
click_link
(
'Archive'
)
expect
(
page
).
to
have_content
(
'Archived'
)
end
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