2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
RSpec.describe 'Dashboard Archived Project' do
|
2017-08-17 22:00:37 +05:30
|
|
|
let(:user) { create :user }
|
2022-08-27 11:52:29 +05:30
|
|
|
let(:project) { create :project }
|
2017-08-17 22:00:37 +05:30
|
|
|
let(:archived_project) { create(:project, :archived) }
|
|
|
|
|
|
|
|
before do
|
2018-11-18 11:00:15 +05:30
|
|
|
project.add_maintainer(user)
|
|
|
|
archived_project.add_maintainer(user)
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
sign_in(user)
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
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
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
it 'renders only archived projects' do
|
|
|
|
click_link 'Show archived projects only'
|
|
|
|
|
|
|
|
expect(page).to have_content(archived_project.name)
|
|
|
|
expect(page).not_to have_content(project.name)
|
|
|
|
end
|
|
|
|
|
2018-12-13 13:39:08 +05:30
|
|
|
it 'searches archived projects', :js do
|
2021-02-22 17:27:13 +05:30
|
|
|
click_button 'Name'
|
2017-08-17 22:00:37 +05:30
|
|
|
click_link 'Show archived projects'
|
|
|
|
|
|
|
|
expect(page).to have_link(project.name)
|
|
|
|
expect(page).to have_link(archived_project.name)
|
|
|
|
|
|
|
|
fill_in 'project-filter-form-field', with: archived_project.name
|
|
|
|
|
|
|
|
find('#project-filter-form-field').native.send_keys :return
|
|
|
|
|
|
|
|
expect(page).not_to have_link(project.name)
|
|
|
|
expect(page).to have_link(archived_project.name)
|
|
|
|
end
|
|
|
|
end
|