webmock-resources 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -14,6 +14,12 @@ module WebMock::Resources
|
|
14
14
|
schema[:object] ? schema[:object].new(resource) : resource
|
15
15
|
end
|
16
16
|
|
17
|
+
def self.create_many resource_name, amount, attributes = {}
|
18
|
+
amount.times.map do
|
19
|
+
create resource_name, attributes
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
17
23
|
def self.stub_resource resource_name, resource
|
18
24
|
url = "webmock/api/#{resource_name}/#{resource[:id]}"
|
19
25
|
stub_request(:get, url).to_return body: JSON.dump(resource), status: 200, headers: headers
|