kanbanworkflowstimelinescrumrubyroadmapproject-planningproject-managementopenprojectangularissue-trackerifcgantt-chartganttbug-trackerboardsbcf
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.
40 lines
1.2 KiB
40 lines
1.2 KiB
7 years ago
|
require 'spec_helper'
|
||
|
|
||
|
describe 'Cost report showing my own times', type: :feature, js: true do
|
||
7 years ago
|
let(:project) { FactoryBot.create :project }
|
||
|
let(:user) { FactoryBot.create :admin }
|
||
|
let(:user2) { FactoryBot.create :admin }
|
||
7 years ago
|
|
||
7 years ago
|
let(:work_package) { FactoryBot.create :work_package, project: project }
|
||
|
let!(:hourly_rate1) { FactoryBot.create :default_hourly_rate, user: user, rate: 1.00, valid_from: 1.year.ago }
|
||
7 years ago
|
|
||
|
let!(:time_entry1) {
|
||
7 years ago
|
FactoryBot.create :time_entry,
|
||
7 years ago
|
user: user,
|
||
|
work_package: work_package,
|
||
|
project: project,
|
||
|
hours: 10
|
||
|
}
|
||
|
|
||
|
before do
|
||
|
login_as(current_user)
|
||
|
visit cost_reports_path(project)
|
||
|
end
|
||
|
|
||
|
|
||
|
context 'as user with logged time' do
|
||
|
let(:current_user) { user }
|
||
|
it 'shows my time' do
|
||
|
expect(page).to have_selector('.report', text: '10.00')
|
||
|
end
|
||
|
end
|
||
|
|
||
|
context 'as user without logged time' do
|
||
|
let(:current_user) { user2 }
|
||
|
it 'shows my time' do
|
||
|
expect(page).to have_no_selector('.report')
|
||
|
expect(page).to have_selector('.generic-table--no-results-title')
|
||
|
expect(page).not_to have_text '10.00' # 1 EUR x 10
|
||
|
end
|
||
|
end
|
||
|
end
|