standardapi 5.0.0.8 → 5.0.0.9

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
  SHA1:
3
- metadata.gz: 8abd5e5fd0edfe43cb7214d68a03ce4c891f055f
4
- data.tar.gz: 30ff7a019df03bae07e7d3f71e1de0f9f6775938
3
+ metadata.gz: 355b1eac6c6248800da339a3a9c40088d9869c4f
4
+ data.tar.gz: 4b2cf5c1701c9e186114791a815e26b6050c47f0
5
5
  SHA512:
6
- metadata.gz: 1b69c45728b4bc4b8a4c63e43217be8f106f41e8a66c9265112a8615d5625bd871f0d0c6b795894b9503a0f25835d246cefa97a605fbba9c9b4c2dba7674ff37
7
- data.tar.gz: 724a6de3959161f946c5d8f6d213a97dc602d85579f618e417cec449f39e763bafd9386666d443499d00b2eeefc206d8be8a306f6ee15dffee75f7bffa1e3ac1
6
+ metadata.gz: 3a7d60767625e7c510f78abb320ea3b2318140aa74dfbc59cb71d8232faa70267d0a61bb02613dcc4f5e67d2ec42ee980c1e6fd06ecd65b7a204ecd383b1821a
7
+ data.tar.gz: fbab67ec986066f5b0b33644276d08b4ff9df6769fbd2aefd5a386b5b0d2832edf172ad120c985d54132747fd65ad660831f6a4d6303d28e7b20256c1d5bd9b4
@@ -8,7 +8,7 @@ module StandardAPI
8
8
  attrs = attributes_for(singular_name).select{ |k,v| !model.readonly_attributes.include?(k.to_s) }
9
9
  create_webmocks(attrs)
10
10
 
11
- put resource_path(:update, :id => m.id, :format => 'json'), params: { singular_name => attrs }
11
+ put resource_path(:update, :id => m.id), params: { singular_name => attrs }, as: :json
12
12
  assert_response :ok, "Updating #{m.class.name} with #{attrs.inspect}"
13
13
 
14
14
  view_attributes(m.reload).select { |x| attrs.keys.map(&:to_s).include?(x) }.each do |key, value|
@@ -26,14 +26,14 @@ module StandardAPI
26
26
  m = create_model
27
27
 
28
28
  # This is just to instance @controller
29
- get resource_path(:show, id: m.id, format: :json)
29
+ get resource_path(:show, id: m.id), as: :json
30
30
 
31
31
  return if @controller.method(:update).owner != StandardAPI
32
32
 
33
33
  attrs = attributes_for(singular_name).select{|k,v| !model.readonly_attributes.include?(k.to_s) }
34
34
  create_webmocks(attrs)
35
35
 
36
- put resource_path(:update, :id => m.id, :format => 'html'), params: { singular_name => attrs }
36
+ put resource_path(:update, :id => m.id), params: { singular_name => attrs }
37
37
 
38
38
  assert_redirected_to m
39
39
  end
@@ -43,7 +43,7 @@ module StandardAPI
43
43
  attrs = attributes_for(singular_name, :nested).select{|k,v| !model.readonly_attributes.include?(k.to_s) }
44
44
  create_webmocks(attrs)
45
45
 
46
- put resource_path(:update, :id => m.id, :format => 'json'), params: { singular_name => attrs }
46
+ put resource_path(:update, :id => m.id), params: { singular_name => attrs }, as: :json
47
47
  assert_response :ok, "Updating #{m.class.name} with #{attrs.inspect}"
48
48
 
49
49
  # (m.attribute_names & attrs.keys.map(&:to_s)).each do |test_key|
@@ -67,7 +67,7 @@ module StandardAPI
67
67
  attrs = attributes_for(singular_name, :invalid).select{|k,v| !model.readonly_attributes.include?(k.to_s) }
68
68
  create_webmocks(attrs)
69
69
 
70
- put resource_path(:update, :id => m.id, :format => 'json'), params: { singular_name => attrs }
70
+ put resource_path(:update, :id => m.id), params: { singular_name => attrs }, as: :json
71
71
  assert_response :bad_request, "Updating #{m.class.name} with invalid attributes #{attrs.inspect}"
72
72
  assert JSON.parse(@response.body)['errors']
73
73
  end
@@ -78,7 +78,7 @@ module StandardAPI
78
78
  attrs = attributes_for(singular_name, :nested).select{|k,v| !model.readonly_attributes.include?(k) }
79
79
  create_webmocks(attrs)
80
80
 
81
- put resource_path(:update, :id => m.id, :format => 'json'), params: { include: includes, singular_name => attrs }
81
+ put resource_path(:update, :id => m.id), params: { include: includes, singular_name => attrs }, as: :json
82
82
  assert_response :ok, "Updating #{m.class.name} with #{attrs.inspect}"
83
83
 
84
84
  controller_model = @controller.instance_variable_get("@#{singular_name}")
@@ -130,7 +130,7 @@ module StandardAPI
130
130
 
131
131
  @controller.current_mask[plural_name] = { id: m.id + 1 }
132
132
  assert_raises(ActiveRecord::RecordNotFound) do
133
- put resource_path(:update, :id => m.id, :format => 'json')
133
+ put resource_path(:update, :id => m.id), as: :json
134
134
  end
135
135
  @controller.current_mask.delete(plural_name)
136
136
  end
@@ -1,3 +1,3 @@
1
1
  module StandardAPI
2
- VERSION = '5.0.0.8'
2
+ VERSION = '5.0.0.9'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standardapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0.8
4
+ version: 5.0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Bracy