standardapi 5.0.0.1 → 5.0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/standard_api/controller.rb +5 -1
- data/lib/standard_api/test_case/create_tests.rb +19 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31258d1d98bb1dae4beda05ea71721d674fc68c8
|
4
|
+
data.tar.gz: 7f74ae15f6e3c8eafc465f8e9cf3bbb3798757c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2d47cccc926d26c23fce93e5ffcd3ef191690a6fe9c051e83239469ce9534b8a38fa605b4edb2ccd8a8684768c41dcf6ded2197076ce6eaed7053ce73fbf879
|
7
|
+
data.tar.gz: 3f54bef16897631aaaaa206ecdefb9c0435146ce21edf7aecb0b46c319906c2c13b2356bb885e81443e7cf53a674330eac2d1d953516e7e315f7d0bd86c2710b
|
@@ -71,6 +71,25 @@ module StandardAPI
|
|
71
71
|
assert json['errors']
|
72
72
|
end
|
73
73
|
end
|
74
|
+
|
75
|
+
test '#create.html with invalid attributes renders edit action' do
|
76
|
+
trait = FactoryGirl.factories[singular_name].definition.defined_traits.any? { |x| x.name.to_s == 'invalid' }
|
77
|
+
|
78
|
+
if !trait
|
79
|
+
Rails.logger.try(:warn, "No invalid trait for #{model.name}. Skipping invalid tests")
|
80
|
+
warn("No invalid trait for #{model.name}. Skipping invalid tests")
|
81
|
+
return
|
82
|
+
end
|
83
|
+
|
84
|
+
attrs = attributes_for(singular_name, :invalid).select{|k,v| !model.readonly_attributes.include?(k.to_s) }
|
85
|
+
create_webmocks(attrs)
|
86
|
+
|
87
|
+
assert_difference("#{model.name}.count", 0) do
|
88
|
+
post :create, params: {singular_name => attrs}, format: :html
|
89
|
+
assert_response :bad_request
|
90
|
+
assert_equal response.body, 'properties#edit.html'
|
91
|
+
end
|
92
|
+
end
|
74
93
|
|
75
94
|
test '#create.json params[:include]' do
|
76
95
|
travel_to Time.now do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: standardapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.0.
|
4
|
+
version: 5.0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Bracy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|