Issue#17703 Test case for tempfile attribute

+ To avoid regression I am adding this test case on action pack though the issue is not from rails side. 
Yes, and add a good message for when it fails