test/resource_test.rb in loquor-1.6.0 vs test/resource_test.rb in loquor-1.7.0
- old
+ new
@@ -51,9 +51,17 @@
email = "foobar"
Loquor.expects(:get).with("/foobar?email=#{email}").returns([])
Foobar.where(email: email).to_a
end
+ %w{where per page order select find_each}.each do |meth|
+ define_method "test_#{meth}_should_proxy" do
+ args = [mock]
+ ApiCall::Index.any_instance.expects(meth).with(*args)
+ Foobar.send(meth, *args)
+ end
+ end
+
def test_create_should_put_correct_params
payload = {bar: 'foo'}
Loquor.expects(:post).with("/foobar", payload: payload)
Foobar.create(payload)
end