I am using Rail 3.2.11, Mac OS X Mountain Lion, Rspec
this My problem is:
I have a model that has been created, it sends information to an API that works fine, but when I am testing it in RSPC, the test data is also API Is sent to the database. Here's the code:
Model I tried this in my test: But this did not work. Every time I have created the model I said in my test, which sends them to the database. Will be appreciated. Thank you very much in the rim! Not sure that you have yet detected it, but if you Mocha can be installed Just tested it and it works After
: create: send_to_api def send_to_api api = APIModule.initialize_api (parameter) api.send_data (self .attribute1, to connect to the API, to send data at the end of the API
Model.any_instance .stub (: Send_to_api) .and_return (true)
Model.any_instance.stubs (: send_to_api). Return (true)
No comments:
Post a Comment