ar_http_wrapper 0.0.7 → 0.0.8
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.
@@ -18,7 +18,7 @@ module ActiveRecordApiWrapper
|
|
18
18
|
|
19
19
|
api_class.desc "Creates a record."
|
20
20
|
api_class.params do
|
21
|
-
requires klass_to_param_key, :
|
21
|
+
requires klass_to_param_key, :desc => "The new record attributes."
|
22
22
|
end
|
23
23
|
api_class.post "/" do
|
24
24
|
klass.create(params[klass_to_param_key])
|
@@ -27,7 +27,7 @@ module ActiveRecordApiWrapper
|
|
27
27
|
api_class.desc "Updates a record."
|
28
28
|
api_class.params do
|
29
29
|
requires :id, :desc => "The record id."
|
30
|
-
requires klass_to_param_key, :
|
30
|
+
requires klass_to_param_key, :desc => "The updated record attributes."
|
31
31
|
end
|
32
32
|
api_class.put "/:id" do
|
33
33
|
updated_attr = params[klass_to_param_key]
|
@@ -19,11 +19,11 @@ shared_examples "ActiveRecordApiWrapper" do |klass,mountpoint,api_version|
|
|
19
19
|
subject.should_receive(:new).and_return(@test_instance)
|
20
20
|
end
|
21
21
|
it "builds instance" do
|
22
|
-
get "#{to_path("
|
22
|
+
get "#{to_path("new")}"
|
23
23
|
response.status.should == 200
|
24
24
|
end
|
25
25
|
it "returns instance" do
|
26
|
-
get "#{to_path("
|
26
|
+
get "#{to_path("new")}"
|
27
27
|
response.status.should == 200
|
28
28
|
JSON.parse(response.body).should == @test_instance
|
29
29
|
end
|