diff options
author | Rémy Coutable <remy@rymai.me> | 2017-01-13 04:53:11 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-01-13 04:53:11 +0000 |
commit | ed85fdb218970497c212731ddc21ee53b1678346 (patch) | |
tree | 5e38bab575e5680204086307cfe372f76cdb966c | |
parent | f20d3cb3faa31c70be0f4d7b6e1428d142b8a48f (diff) | |
parent | e393151d76c5847de46e8d956e6c5947e321e156 (diff) | |
download | gitlab-ce-ed85fdb218970497c212731ddc21ee53b1678346.tar.gz |
Merge branch 'move-dashboard-archived-projects-spinach-to-rspec' into 'master'
Move dashboard archived projects spinach tests to rspec
See merge request !8431
-rw-r--r-- | features/dashboard/archived_projects.feature | 17 | ||||
-rw-r--r-- | features/steps/dashboard/archived_projects.rb | 26 | ||||
-rw-r--r-- | spec/factories/projects.rb | 4 | ||||
-rw-r--r-- | spec/features/dashboard/archived_projects_spec.rb | 28 |
4 files changed, 32 insertions, 43 deletions
diff --git a/features/dashboard/archived_projects.feature b/features/dashboard/archived_projects.feature deleted file mode 100644 index bed9282f1c6..00000000000 --- a/features/dashboard/archived_projects.feature +++ /dev/null @@ -1,17 +0,0 @@ -@dashboard -Feature: Dashboard 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 toggle show of archived projects on dashboard - When I click "Show archived projects" link - Then I should see "Shop" project link - And I should see "Forum" project link diff --git a/features/steps/dashboard/archived_projects.rb b/features/steps/dashboard/archived_projects.rb deleted file mode 100644 index 6510f8d9b32..00000000000 --- a/features/steps/dashboard/archived_projects.rb +++ /dev/null @@ -1,26 +0,0 @@ -class Spinach::Features::DashboardArchivedProjects < 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 - - step 'I should see "Shop" project link' do - expect(page).to have_link "Shop" - end - - step 'I should not see "Forum" project link' do - expect(page).not_to have_link "Forum" - end - - step 'I should see "Forum" project link' do - expect(page).to have_link "Forum" - end - - step 'I click "Show archived projects" link' do - click_link "Show archived projects" - end -end diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb index f7fa834d7a2..1cdbe4fc9a5 100644 --- a/spec/factories/projects.rb +++ b/spec/factories/projects.rb @@ -24,6 +24,10 @@ FactoryGirl.define do visibility_level Gitlab::VisibilityLevel::PRIVATE end + trait :archived do + archived true + end + trait :access_requestable do request_access_enabled true end diff --git a/spec/features/dashboard/archived_projects_spec.rb b/spec/features/dashboard/archived_projects_spec.rb new file mode 100644 index 00000000000..038c1641be9 --- /dev/null +++ b/spec/features/dashboard/archived_projects_spec.rb @@ -0,0 +1,28 @@ +require 'spec_helper' + +RSpec.describe 'Dashboard Archived Project', feature: true do + let(:user) { create :user } + let(:project) { create :project} + let(:archived_project) { create(:project, :archived) } + + before do + project.team << [user, :master] + archived_project.team << [user, :master] + + login_as(user) + + visit dashboard_projects_path + end + + it 'renders non archived projects' do + expect(page).to have_link(project.name) + expect(page).not_to have_link(archived_project.name) + end + + it 'renders all projects' do + click_link 'Show archived projects' + + expect(page).to have_link(project.name) + expect(page).to have_link(archived_project.name) + end +end |