Testing Image validation and getting error for rspec mocks