diff options
| author | Douwe Maan <me@douwe.me> | 2015-08-19 08:53:08 -0700 |
|---|---|---|
| committer | Douwe Maan <me@douwe.me> | 2015-08-19 08:53:08 -0700 |
| commit | 4df4097e32dc17f4330de9246362ee9df9155345 (patch) | |
| tree | a61bf43fa37efadc97bdca8c434909f81f733c2f /features/steps | |
| parent | 3659d3b5c6eb645756b3df79a22471f8695f133b (diff) | |
| parent | 07190227395674715522f7a6aef30d4235b5d55c (diff) | |
| download | gitlab-ce-4df4097e32dc17f4330de9246362ee9df9155345.tar.gz | |
Merge pull request #9551 from Telekom-PD/feature/search-for-archived-projects
Feature/search for archived projects
Diffstat (limited to 'features/steps')
| -rw-r--r-- | features/steps/admin/projects.rb | 16 | ||||
| -rw-r--r-- | features/steps/groups.rb | 9 | ||||
| -rw-r--r-- | features/steps/shared/paths.rb | 4 | ||||
| -rw-r--r-- | features/steps/shared/project.rb | 23 |
4 files changed, 52 insertions, 0 deletions
diff --git a/features/steps/admin/projects.rb b/features/steps/admin/projects.rb index 655f1895279..17233f89f38 100644 --- a/features/steps/admin/projects.rb +++ b/features/steps/admin/projects.rb @@ -2,6 +2,13 @@ class Spinach::Features::AdminProjects < Spinach::FeatureSteps include SharedAuthentication include SharedPaths include SharedAdmin + include SharedProject + + step 'I should see all non-archived projects' do + Project.non_archived.each do |p| + expect(page).to have_content p.name_with_namespace + end + end step 'I should see all projects' do Project.all.each do |p| @@ -9,6 +16,15 @@ class Spinach::Features::AdminProjects < Spinach::FeatureSteps end end + step 'I check "Show archived projects"' do + page.check 'Show archived projects' + click_button "Search" + end + + step 'I should see "archived" label' do + expect(page).to have_xpath("//span[@class='label label-warning']", text: 'archived') + end + step 'I click on first project' do click_link Project.first.name_with_namespace end diff --git a/features/steps/groups.rb b/features/steps/groups.rb index 46e1f4d0990..18a1c4d32ce 100644 --- a/features/steps/groups.rb +++ b/features/steps/groups.rb @@ -226,6 +226,15 @@ class Spinach::Features::Groups < Spinach::FeatureSteps expect(page).to have_link(@mr3.title, href: namespace_project_merge_request_path(@project3.namespace, @project3, @mr3)) end + step 'Group "Owned" has archived project' do + group = Group.find_by(name: 'Owned') + create(:project, namespace: group, archived: true, path: "archived-project") + end + + step 'I should see "archived" label' do + expect(page).to have_xpath("//span[@class='label label-warning']", text: 'archived') + end + protected def assigned_to_me(key) diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index bb0cd9ac105..ca8fbb49101 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -39,6 +39,10 @@ module SharedPaths visit edit_group_path(Group.find_by(name: "Owned")) end + step 'I visit group "Owned" projects page' do + visit projects_group_path(Group.find_by(name: "Owned")) + end + step 'I visit group "Guest" page' do visit group_path(Group.find_by(name: "Guest")) end diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb index 9ee2e5dfbed..ccbe8f96a4c 100644 --- a/features/steps/shared/project.rb +++ b/features/steps/shared/project.rb @@ -93,6 +93,29 @@ module SharedProject end # ---------------------------------------- + # Visibility of archived project + # ---------------------------------------- + + step 'archived project "Archive"' do + create :project, :public, archived: true, name: 'Archive' + end + + step 'I should not see project "Archive"' do + project = Project.find_by(name: "Archive") + expect(page).not_to have_content project.name_with_namespace + end + + step 'I should see project "Archive"' do + project = Project.find_by(name: "Archive") + expect(page).to have_content project.name_with_namespace + end + + step 'project "Archive" has comments' do + project = Project.find_by(name: "Archive") + 2.times { create(:note_on_issue, project: project) } + end + + # ---------------------------------------- # Visibility level # ---------------------------------------- |
