webmock-resources 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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
|