Hi, I have two model: Message, User
message.rb
```
class Message < ActiveRecord::Base
class << self
def method_a(args)
[1,2]
end
end
end
```
user.rb
```
class User < ActiveRecord::Base
def method_user
if Message.method_a('anythings')
#... some code
end
end
end
```
I want to test method_user,but I don't want to test Message#method_a
How I can mock Message with method_a?
Thanks!
on 2012-07-27 07:31
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.