diff options
Diffstat (limited to 'features')
-rw-r--r-- | features/dashboard/archived_projects.feature | 16 | ||||
-rw-r--r-- | features/project/archived_projects.feature | 39 | ||||
-rw-r--r-- | features/steps/dashboard/dashboard_with_archived_projects.rb | 22 | ||||
-rw-r--r-- | features/steps/project/project_archived.rb | 37 | ||||
-rw-r--r-- | features/steps/shared/project.rb | 7 |
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") |