You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dupe::Network::Mock::ResourceNotFoundError in 'User#find_by_id should return nil if the id is not correct'
Failed with 404: the request '/v1/users/202.xml' returned nil.
But my code in the model looks like this:
def self.find_by_id(user_id)
find(user_id)
rescue ActiveResource::ResourceNotFound
nil
end
I find it odd that Dupe doesn't throw up ActiveResource::ResourceNotFound errors since that's what one would be rescuing in the code. My spec doesn't work because the error is being raised, even though I'm rescuing the real-world exception.:
it "should return nil if the id is not correct" do
User.find_by_id(@user.id + 200).should be_nil
end
Sorry if it feels like I'm being nitpicky with dupe! I reaaaally love dupe :) It's great and does just about everything I need. But there are these couple things I feel it's missing to be really stellar
The text was updated successfully, but these errors were encountered:
I'm getting this error:
But my code in the model looks like this:
I find it odd that Dupe doesn't throw up
ActiveResource::ResourceNotFound
errors since that's what one would be rescuing in the code. My spec doesn't work because the error is being raised, even though I'm rescuing the real-world exception.:Sorry if it feels like I'm being nitpicky with dupe! I reaaaally love dupe :) It's great and does just about everything I need. But there are these couple things I feel it's missing to be really stellar
The text was updated successfully, but these errors were encountered: