Skip to content

Commit

Permalink
Test for acceptance content
Browse files Browse the repository at this point in the history
  • Loading branch information
ancorgs committed May 2, 2014
1 parent efd7104 commit d7a752e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
13 changes: 13 additions & 0 deletions spec/features/reimbursement_process_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@
@pdf.should include('Payee Name')
@pdf.should include('Luke Skywalker')

# Check the acceptance
visit request_reimbursement_acceptance_path(@reimbursement.request)
pdf_content.should include('Just an example')

# Process the reimbursement
visit request_reimbursement_path(@reimbursement.request)
click_link "Action"
Expand All @@ -182,5 +186,14 @@
click_button "confirm"
page.should have_content "Confirmation processed"
page.should have_content "process have ended succesfully"

# Final check,
# try to access the acceptance or the check request as another user
click_link "Log out"
sign_in_as_user users(:wedge)
visit request_reimbursement_acceptance_path(@reimbursement.request)
page.status_code.should == 403
visit check_request_request_reimbursement_path(@reimbursement.request)
page.status_code.should == 403
end
end
6 changes: 4 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
# First of all, coveralls
require 'simplecov'
require 'coveralls'
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
SimpleCov.start do
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter ]
SimpleCov.start 'rails' do
# Not covered because they are overriden in spec/support/carrierwave.rb
add_filter 'app/uploaders/'
end
Expand Down

0 comments on commit d7a752e

Please sign in to comment.