parent
b54e955e56
commit
3983c44c16
@ -0,0 +1,33 @@ |
||||
require 'spec_helper' |
||||
|
||||
describe 'Project context switching spec', js: true do |
||||
let(:user) { FactoryGirl.create :admin } |
||||
|
||||
let(:project) { FactoryGirl.create(:project) } |
||||
let(:work_package) { FactoryGirl.create(:work_package, project: project) } |
||||
|
||||
let(:wp_table) { Pages::WorkPackagesTable.new } |
||||
let(:wp_page) { Pages::FullWorkPackage.new(work_package, project) } |
||||
|
||||
before do |
||||
login_as(user) |
||||
work_package |
||||
end |
||||
|
||||
it 'allows to switch context' do |
||||
wp_table.visit! |
||||
wp_table.expect_work_package_listed work_package |
||||
|
||||
# Open WP in global selection |
||||
wp_table.open_full_screen_by_link work_package |
||||
|
||||
# Follow link to project context |
||||
expect(page).to have_selector('.attributes-group.-project-context') |
||||
link = find('.attributes-group.-project-context .project-context--switch-link') |
||||
expect(link[:href]).to include(project_work_package_path(project.id, work_package.id)) |
||||
|
||||
link.click |
||||
wp_page.ensure_page_loaded |
||||
expect(page).to have_no_selector('.attributes-group.-project-context') |
||||
end |
||||
end |
Loading…
Reference in new issue