OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/spec/features/project_context_spec.rb

24 lines
752 B

require 'spec_helper'
require_relative 'support/pages/cost_report_page'
describe 'Cost report project context', type: :feature, js: true do
let(:project1) { FactoryGirl.create :project }
let(:project2) { FactoryGirl.create :project }
let(:admin) { FactoryGirl.create :admin }
let(:report_page) { ::Pages::CostReportPage.new project }
before do
project1
project2
login_as admin
end
it "switches the project context when visiting another project's cost report" do
visit cost_reports_path(project1)
expect(page).to have_selector('#project_id_arg_1_val option', text: project1.name)
visit cost_reports_path(project2)
expect(page).to have_selector('#project_id_arg_1_val option', text: project2.name)
end
end