Created
July 30, 2011 19:01
-
-
Save mikebannister/1115858 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'acceptance/support/acceptance_helper' | |
feature "Add manual timesheet to payroll report", %q{ | |
In order to tweak the payroll report | |
As an admin | |
I want to manually attach timesheets to the report | |
} do | |
background do | |
generate_full_payroll_data | |
# An account that we can select when manually adding timesheet | |
account = Factory(:account, qb_name: "Lulu Corp") | |
Factory(:task, name: "Lulu Task", account: account) | |
# get to the payroll report | |
sign_in :then_visit => payroll_report_path | |
select '2010-04-25', :from => :pay_period | |
click_button 'Run' | |
end | |
scenario "Add manual timesheet to report" do | |
# dig inside the payroll table to get to the cell with the link | |
within("table#payroll_report tbody tr:first-child td:nth-child(5)") do | |
click_link "Add manual timesheet" | |
end | |
response.should have_selector("h1") do |heading| | |
heading.should contain "New Manual Timesheet" | |
end | |
select 'Lulu Corp:Lulu Task', :from => :task | |
fill_in 'Date', with: '04/24/2010' | |
fill_in 'Hours', with: '2' | |
fill_in 'Note', with: 'A timesheet note' | |
click_button "Create Manual Timesheet" | |
response.should contain "Successfully created manual timesheet." | |
response.should contain "Payroll report for 2010-04-25" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment