diff options
author | Rémy Coutable <remy@rymai.me> | 2017-01-13 07:53:11 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-01-13 07:53:11 +0300 |
commit | ed85fdb218970497c212731ddc21ee53b1678346 (patch) | |
tree | 5e38bab575e5680204086307cfe372f76cdb966c /spec | |
parent | f20d3cb3faa31c70be0f4d7b6e1428d142b8a48f (diff) | |
parent | e393151d76c5847de46e8d956e6c5947e321e156 (diff) |
Merge branch 'move-dashboard-archived-projects-spinach-to-rspec' into 'master'
Move dashboard archived projects spinach tests to rspec
See merge request !8431
Diffstat (limited to 'spec')
-rw-r--r-- | spec/factories/projects.rb | 4 | ||||
-rw-r--r-- | spec/features/dashboard/archived_projects_spec.rb | 28 |
2 files changed, 32 insertions, 0 deletions
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 |