Closed janpaul123 closed 11 years ago
Please also add a test which reproduces the bug this pull-request fixes.
Just added a testcase for this, but i can't seem to reproduce this issue.
let 'test_class_with_private_authorized?' do
Class.new do
include Pavlov::Interactor
private
def authorized?
true
end
end
end
it "raises an error when .authorized? does not exist" do
expect {
test_class_with_private_authorized?.new
}.to_not raise_error(NotImplementedError)
end
The problem was that when you return false, it will let you through, and not say it isn't authorized. So make the test to return false, and expect an AuthorizationError (or whatever it's called)
Coverage decreased (-0%) when pulling ec4a3f8d42a6e3b48490d2018ce985e555ad0c7c on feature/fix-authorized into 72a5ebb1577a377e7fff05cee028129d452cdb8c on develop.