Skip to content

Commit

Permalink
rspec testing that exec_api_call accepts Hash as result object
Browse files Browse the repository at this point in the history
  • Loading branch information
yrudman committed Nov 16, 2018
1 parent 1e89ce1 commit 65aac7e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec/models/mixins/inter_region_api_method_relay_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ def expect_api_call(expected_action, expected_args = nil)
}.to raise_error(described_class::InterRegionApiMethodRelayError)
end

it "accepts Hash object as api result" do
expect(api_collection).to receive(action).and_return({})
expect { described_class.exec_api_call(region, collection_name, action) }.not_to raise_error
end

it "calls the given action with the given args" do
args = {:my => "args", :here => 123}
expect(api_collection).to receive(action).with(args).and_return(api_success_result)
Expand Down

0 comments on commit 65aac7e

Please sign in to comment.