decent_exposure 3.0.3 → 3.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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f14b1fe6ed0c7cfea5f043262895e4f17bbd9cdd8f019259d8d0a44fb1f9f98
|
4
|
+
data.tar.gz: b5e0989425e1f94847b6867c4a0e81bd87d07a9fcd2683c9d64412700f7fd0d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 705363f8c4b0fe230b6a25b3e171e74f936d1d1bc34af6a10b809d8283324c2b7a249e00d5455f5c2cec28944cf3aee94f0c2487b1c45f2b99a8ba0e60e732a8
|
7
|
+
data.tar.gz: d784e10c482a0a9e35c4aa21cf51632d6d0d28c0055f1f0b302259505c8b4f2d7feac9208af402a02a799ffca444c81d89f52ed278ef380096f1e6b45b30100c
|
data/lib/decent_exposure/flow.rb
CHANGED
@@ -190,14 +190,14 @@ RSpec.describe DecentExposure::Controller do
|
|
190
190
|
|
191
191
|
it "uses params method on non-get request" do
|
192
192
|
expose :thing
|
193
|
-
expect(request).to
|
193
|
+
expect(request).to receive_messages(get?: false, head?: false)
|
194
194
|
expect(Thing).to receive(:new).with(foo: :bar).and_return(thing)
|
195
195
|
expect(controller).to receive(:thing_params).and_return(foo: :bar)
|
196
196
|
end
|
197
197
|
|
198
198
|
it "can use custom params method name" do
|
199
199
|
expose :thing, build_params: :custom_params_method_name
|
200
|
-
expect(request).to
|
200
|
+
expect(request).to receive_messages(get?: false, head?: false)
|
201
201
|
expect(Thing).to receive(:new).with(foo: :bar).and_return(thing)
|
202
202
|
expect(controller).to receive(:custom_params_method_name).and_return(foo: :bar)
|
203
203
|
end
|
@@ -38,6 +38,13 @@ RSpec.describe BirdsController, type: :controller do
|
|
38
38
|
get :new
|
39
39
|
expect(controller.bird).to be_a(Bird)
|
40
40
|
end
|
41
|
+
|
42
|
+
context "when request.method is HEAD" do
|
43
|
+
it "builds bird if id is not provided" do
|
44
|
+
head :new
|
45
|
+
expect(controller.bird).to be_a(Bird)
|
46
|
+
end
|
47
|
+
end
|
41
48
|
end
|
42
49
|
|
43
50
|
context "when bird_params is defined" do
|