2017-01-04 03:30:11 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-06-29 00:13:10 -04:00
|
|
|
RSpec.describe 'Dashboard Archived Project' do
|
2017-01-04 03:30:11 -05:00
|
|
|
let(:user) { create :user }
|
|
|
|
let(:project) { create :project}
|
2017-08-02 15:55:11 -04:00
|
|
|
let(:archived_project) { create(:project, :archived) }
|
2017-01-04 03:30:11 -05:00
|
|
|
|
|
|
|
before do
|
2017-12-22 03:18:28 -05:00
|
|
|
project.add_master(user)
|
|
|
|
archived_project.add_master(user)
|
2017-01-04 03:30:11 -05:00
|
|
|
|
2017-06-21 19:44:10 -04:00
|
|
|
sign_in(user)
|
2017-01-04 03:30:11 -05:00
|
|
|
|
|
|
|
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
|
2017-03-01 11:17:26 -05:00
|
|
|
|
2017-08-11 05:09:17 -04:00
|
|
|
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
|
|
|
|
|
2017-03-01 11:17:26 -05:00
|
|
|
it 'searchs archived projects', :js do
|
|
|
|
click_button 'Last updated'
|
|
|
|
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
|
2017-01-04 03:30:11 -05:00
|
|
|
end
|