json_voorhees 0.5.4 → 0.5.5

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: 19cee2cbb368cf8feb39e78425f41db2364a2755
4
- data.tar.gz: fae299cbf3d803d495d3709b8891d998f17e207b
3
+ metadata.gz: b042ee66e3328f4870f3e78b768dcb2c1438bb73
4
+ data.tar.gz: 1009ea01dae0b8aaae0faa233321357d00715a26
5
5
  SHA512:
6
- metadata.gz: 009443163245d1b82f1c2ee15200928ebf016b6f7b3a0f9d03a83b341112bead17c5508a3a844d442ff7c593006d0620f05394260d2848ec911768901b90ab26
7
- data.tar.gz: b031d30c5711471bc7fe832a4197df79e536f45707a0688fa75166ddd366681c4b28b53865ff93344f2a51c4be744f90fdcf4626cab4a822a497b5521f9038a3
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 'api/<%= api_version %>/<%= resource_plural %>/1'
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
- hash = {"<%= resource_singular %>" => attrs}
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 %>/1", hash
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
- hash = {"<%= resource_singular %>" => attrs}
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 'api/<%= api_version %>/<%= resource_plural %>/1'
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 'api/<%= api_version %>/<%= resource_plural %>/20'
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 'api/<%= api_version %>/<%= resource_plural %>/1', nil, @header
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
- post 'api/<%= api_version %>/<%= resource_plural %>', hash, @header
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
- hash = {"<%= resource_singular %>" => attrs}
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 'api/<%= api_version %>/<%= resource_plural %>/1', nil, @header
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 'api/<%= api_version %>/<%= resource_plural %>/20', nil, @header
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
@@ -1,3 +1,3 @@
1
1
  module JsonVoorhees
2
- VERSION = "0.5.4"
2
+ VERSION = "0.5.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_voorhees
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cleophus Robinson