Last active
December 20, 2015 19:58
-
-
Save jgraichen/6186630 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let!(:operation) { Acfs::Stub.resource :update, MyResource, with: { id: 1, key: "value" }, return: { id: 1, key: "value" } } | |
it "should call update action" do | |
# call you complex method here | |
# eg. call controller method with form params | |
post :update, id: 1, my_resource: { key: "value" }, format: "json" | |
expect(operation).to be_called | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You can also test for a specific call count | |
expect(operation).to be_called 5.times |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment