json_voorhees 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b042ee66e3328f4870f3e78b768dcb2c1438bb73
|
4
|
+
data.tar.gz: 1009ea01dae0b8aaae0faa233321357d00715a26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fbdd8f41b9d344eeb731bf8117aba9da21cb2fc991d5f4e682798af12b6a13f4a6b7905d54a05456dae7c6c865d7e7c52033a24c0205a6a960f9c26bc57d6f6
|
7
|
+
data.tar.gz: 476bdab6ef62ee34e16dbd436933b871b4e8ef48e4e89e6a9363c438c616d7fb17d3ac39ff93d5ae7e4f7ae5937b8dc3d84dc0f7734816d04c0592295a4f3eaa
|
@@ -19,8 +19,8 @@ RSpec.describe ::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>
|
|
19
19
|
end
|
20
20
|
# get /api/<%= api_version %>/<%= resource_plural %>/1
|
21
21
|
it "Gets a <%= resource_singular %> by id" do
|
22
|
-
FactoryGirl.create(:<%= module_snake %>_<%= resource_singular %>_<%= api_version %>)
|
23
|
-
get
|
22
|
+
<%= resource_singular %> = FactoryGirl.create(:<%= module_snake %>_<%= resource_singular %>_<%= api_version %>)
|
23
|
+
get "api/<%= api_version %>/<%= resource_plural %>/#{<%= resource_singular %>.id}"
|
24
24
|
expect(response.status).to eq(200) #ok
|
25
25
|
end
|
26
26
|
end
|
@@ -48,12 +48,11 @@ RSpec.describe ::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>
|
|
48
48
|
#Create the <%= resource_singular %> through the api
|
49
49
|
attrs = FactoryGirl.attributes_for(:<%= module_snake %>_<%= resource_singular %>_<%= api_version %>)
|
50
50
|
#attrs[:column] = "LaunchU"
|
51
|
-
|
52
|
-
post 'api/<%= api_version %>/<%= resource_plural %>', hash
|
51
|
+
<%= resource_singular %> = FactoryGirl.create(:<%= module_snake %>_<%= resource_singular %>_<%= api_version %>)
|
53
52
|
#Now update the created <%= resource_singular %> by changing the <%= resource_singular %>name
|
54
53
|
#attrs[:column] = "BlastOff"
|
55
54
|
hash = {"<%= resource_singular %>" => attrs}
|
56
|
-
put "api/<%= api_version %>/<%= resource_plural
|
55
|
+
put "api/<%= api_version %>/<%= resource_plural %>/#{<%= resource_singular %>.id}", hash
|
57
56
|
expect(response.status).to eq(200) #ok
|
58
57
|
end
|
59
58
|
end
|
@@ -67,11 +66,10 @@ RSpec.describe ::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>
|
|
67
66
|
#Create the <%= resource_singular %> through the api
|
68
67
|
attrs = FactoryGirl.attributes_for(:<%= module_snake %>_<%= resource_singular %>_<%= api_version %>)
|
69
68
|
#attrs[:column] = "LaunchU"
|
70
|
-
|
71
|
-
post 'api/<%= api_version %>/<%= resource_plural %>', hash
|
69
|
+
<%= resource_singular %> = FactoryGirl.create(:<%= module_snake %>_<%= resource_singular %>_<%= api_version %>)
|
72
70
|
expect(<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.count).to eq(1)
|
73
71
|
#Now delete the <%= resource_singular %> through the api
|
74
|
-
delete
|
72
|
+
delete "api/<%= api_version %>/<%= resource_plural %>/#{<%= resource_singular %>.id}"
|
75
73
|
expect(json).to eq({})
|
76
74
|
expect(response.status).to eq(200) #ok
|
77
75
|
expect(<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.count).to eq(0)
|
@@ -106,8 +104,8 @@ RSpec.describe ::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>
|
|
106
104
|
end
|
107
105
|
# get /api/<%= api_version %>/<%= resource_plural %>/1
|
108
106
|
it "checks for a 404" do
|
109
|
-
FactoryGirl.create(:<%= module_snake %>_<%= resource_singular %>_<%= api_version %>)
|
110
|
-
get
|
107
|
+
<%= resource_singular %> = FactoryGirl.create(:<%= module_snake %>_<%= resource_singular %>_<%= api_version %>)
|
108
|
+
get "api/<%= api_version %>/<%= resource_plural %>/#{<%= resource_singular %>.id + 1}", nil, @header
|
111
109
|
expect(response.status).to eq(404) #ok
|
112
110
|
end
|
113
111
|
end
|
@@ -25,8 +25,8 @@ RSpec.describe ::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>
|
|
25
25
|
end
|
26
26
|
# get /api/<%= api_version %>/<%= resource_plural %>/1
|
27
27
|
it "Gets a <%= resource_singular %> by id" do
|
28
|
-
FactoryGirl.create(:<%= module_snake %>_<%= resource_singular %>_<%= api_version %>)
|
29
|
-
get
|
28
|
+
<%= resource_singular %> = FactoryGirl.create(:<%= module_snake %>_<%= resource_singular %>_<%= api_version %>)
|
29
|
+
get "api/<%= api_version %>/<%= resource_plural %>/#{<%= resource_singular %>.id}", nil, @header
|
30
30
|
expect(response.status).to eq(200) #ok
|
31
31
|
end
|
32
32
|
end
|
@@ -60,12 +60,9 @@ RSpec.describe ::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>
|
|
60
60
|
#Create the <%= resource_singular %> through the api
|
61
61
|
attrs = FactoryGirl.attributes_for(:<%= module_snake %>_<%= resource_singular %>_<%= api_version %>)
|
62
62
|
#attrs[:column] = "LaunchU"
|
63
|
+
<%= resource_singular %> = FactoryGirl.create(:<%= module_snake %>_<%= resource_singular %>_<%= api_version %>)
|
63
64
|
hash = {"<%= resource_singular %>" => attrs}
|
64
|
-
|
65
|
-
#Now update the created <%= resource_singular %> by changing the <%= resource_singular %>name
|
66
|
-
#attrs[:column] = "BlastOff"
|
67
|
-
hash = {"<%= resource_singular %>" => attrs}
|
68
|
-
put "api/<%= api_version %>/<%= resource_plural %>/1", hash, @header
|
65
|
+
put "api/<%= api_version %>/<%= resource_plural %>/#{<%= resource_singular %>.id}", hash, @header
|
69
66
|
expect(response.status).to eq(200) #ok
|
70
67
|
end
|
71
68
|
end
|
@@ -82,11 +79,10 @@ RSpec.describe ::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>
|
|
82
79
|
#Create the <%= resource_singular %> through the api
|
83
80
|
attrs = FactoryGirl.attributes_for(:<%= module_snake %>_<%= resource_singular %>_<%= api_version %>)
|
84
81
|
#attrs[:column] = "LaunchU"
|
85
|
-
|
86
|
-
post 'api/<%= api_version %>/<%= resource_plural %>', hash, @header
|
82
|
+
<%= resource_singular %> = FactoryGirl.create(:<%= module_snake %>_<%= resource_singular %>_<%= api_version %>)
|
87
83
|
expect(<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.count).to eq(1)
|
88
84
|
#Now delete the <%= resource_singular %> through the api
|
89
|
-
delete
|
85
|
+
delete "api/<%= api_version %>/<%= resource_plural %>/#{<%= resource_singular %>.id}", nil, @header
|
90
86
|
expect(json).to eq({})
|
91
87
|
expect(response.status).to eq(200) #ok
|
92
88
|
expect(<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.count).to eq(0)
|
@@ -130,8 +126,8 @@ RSpec.describe ::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>
|
|
130
126
|
end
|
131
127
|
# get /api/<%= api_version %>/<%= resource_plural %>/1
|
132
128
|
it "checks for a 404" do
|
133
|
-
FactoryGirl.create(:<%= module_snake %>_<%= resource_singular %>_<%= api_version %>)
|
134
|
-
get
|
129
|
+
<%= resource_singular %> = FactoryGirl.create(:<%= module_snake %>_<%= resource_singular %>_<%= api_version %>)
|
130
|
+
get "api/<%= api_version %>/<%= resource_plural %>/#{<%= resource_singular %>.id + 1}", nil, @header
|
135
131
|
expect(response.status).to eq(404) #ok
|
136
132
|
end
|
137
133
|
end
|