Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Thonus <steven@ln2.nl>2013-11-29 20:10:59 +0400
committerSteven Thonus <steven@ln2.nl>2013-12-16 17:39:14 +0400
commit37383966ef3fada865d3d21a8ce7a3c640bbd11e (patch)
treec7fe9015cd5d3b336e868498bb478fd523de0a86 /features
parent99490159e5f9d6ff4b45f78b977d01caa1e3c4fc (diff)
Archiving old projects; archived projects aren't shown on dashboard
features for archive projects abilities for archived project other abilities for archive projects only limit commits and merges for archived projects ability changed to prohibited actions on archived projects added spec and feature tests for archive projects changed search bar not to include archived projects
Diffstat (limited to 'features')
-rw-r--r--features/dashboard/archived_projects.feature16
-rw-r--r--features/project/archived_projects.feature39
-rw-r--r--features/steps/dashboard/dashboard_with_archived_projects.rb22
-rw-r--r--features/steps/project/project_archived.rb37
-rw-r--r--features/steps/shared/project.rb7
5 files changed, 121 insertions, 0 deletions
diff --git a/features/dashboard/archived_projects.feature b/features/dashboard/archived_projects.feature
new file mode 100644
index 00000000000..399c9b53d81
--- /dev/null
+++ b/features/dashboard/archived_projects.feature
@@ -0,0 +1,16 @@
+Feature: Dashboard with archived projects
+ Background:
+ Given I sign in as a user
+ And I own project "Shop"
+ And I own project "Forum"
+ And project "Forum" is archived
+ And I visit dashboard page
+
+ Scenario: I should see non-archived projects on dashboard
+ Then I should see "Shop" project link
+ And I should not see "Forum" project link
+
+ Scenario: I should see all projects on projects page
+ And I visit dashboard projects page
+ Then I should see "Shop" project link
+ And I should see "Forum" project link
diff --git a/features/project/archived_projects.feature b/features/project/archived_projects.feature
new file mode 100644
index 00000000000..9aac29384ba
--- /dev/null
+++ b/features/project/archived_projects.feature
@@ -0,0 +1,39 @@
+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 should not see archived on projects page with no archived projects
+ And I visit dashboard projects page
+ Then I should not see "Archived"
+
+ Scenario: I should see archived on projects page with archived projects
+ And project "Forum" is archived
+ And I visit dashboard projects 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"
diff --git a/features/steps/dashboard/dashboard_with_archived_projects.rb b/features/steps/dashboard/dashboard_with_archived_projects.rb
new file mode 100644
index 00000000000..700f4b426c3
--- /dev/null
+++ b/features/steps/dashboard/dashboard_with_archived_projects.rb
@@ -0,0 +1,22 @@
+class DashboardWithArchivedProjects < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedPaths
+ include SharedProject
+
+ When 'project "Forum" is archived' do
+ project = Project.find_by_name "Forum"
+ project.update_attribute(:archived, true)
+ end
+
+ Then 'I should see "Shop" project link' do
+ page.should have_link "Shop"
+ end
+
+ Then 'I should not see "Forum" project link' do
+ page.should_not have_link "Forum"
+ end
+
+ Then 'I should see "Forum" project link' do
+ page.should have_link "Forum"
+ end
+end
diff --git a/features/steps/project/project_archived.rb b/features/steps/project/project_archived.rb
new file mode 100644
index 00000000000..149d293cd08
--- /dev/null
+++ b/features/steps/project/project_archived.rb
@@ -0,0 +1,37 @@
+class 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
+
+ Then 'I should not see "Archived"' do
+ page.should_not have_content "Archived"
+ end
+
+ Then 'I should see "Archived"' do
+ page.should 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 \ No newline at end of file
diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb
index cef66b038db..3dc4932a09a 100644
--- a/features/steps/shared/project.rb
+++ b/features/steps/shared/project.rb
@@ -14,6 +14,13 @@ module SharedProject
@project.team << [@user, :master]
end
+ # Create another specific project called "Forum"
+ And 'I own project "Forum"' do
+ @project = Project.find_by_name "Forum"
+ @project ||= create(:project_with_code, name: "Forum", namespace: @user.namespace, path: 'forum_project')
+ @project.team << [@user, :master]
+ end
+
And 'project "Shop" has push event' do
@project = Project.find_by_name("Shop")