grape-scaffold 0.0.1 → 0.0.2

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: 60dd30d57edc0adcb25d2e1d0f1d313d385f5a48
4
- data.tar.gz: 7160dbd560b6805a5ef0da6de90c442949e3fc3a
3
+ metadata.gz: e42fe486aee7e3da39562e655330c0edbe01d8a0
4
+ data.tar.gz: 0c9f17bd0cb5216555b7bbc4db07a8c9acbe8905
5
5
  SHA512:
6
- metadata.gz: fffe1673c00d08142d2d7aa86b3c9a8c30ef831a4ba57798440b1cf3d13b6153b6661839df34ac332122962057e748f0b16bf4d8d9da7f624435fcb1e39d61f8
7
- data.tar.gz: a6174842988dec728e4710d90e89ee8839055d659ba120f29d38a549cb60925b2b4ccd90d374e026749c44e3d0d9ce3f54bf10810f702c8e9eb37ac17cfa7043
6
+ metadata.gz: 2b398561ae07708df0c381f0f172079d8d77ff92074a3e2122b1ea83c144bf44e816746eb4014e5fc47e68b2e89af044639bff0fbd9190abd486f27b2a4b9580
7
+ data.tar.gz: 0ff373938e2865cb109ba34451dd0cc6b46c0b95cae9819d51a67ebdda7385142726972e9d1538c5df1089cf7227fa042c63adeb425343dfa48ea30b52cdd230
@@ -37,17 +37,6 @@ module API
37
37
  end
38
38
  end
39
39
 
40
- # Delete a <%= model_name.underscore.singularize %>
41
- #
42
- # Example Request:
43
- # DELETE /v1/<%= model_name.pluralize.underscore %>/:id
44
- params do
45
- requires :id
46
- end
47
- delete ':id' do
48
- <%= model_name.camelize.singularize %>.destroy(params[:id])
49
- end
50
-
51
40
  # Edit a <%= model_name.underscore.singularize %>
52
41
  #
53
42
  # Example Request:
@@ -63,6 +52,17 @@ module API
63
52
  <%= model_name.underscore.singularize %>.errors
64
53
  end
65
54
  end
55
+
56
+ # Delete a <%= model_name.underscore.singularize %>
57
+ #
58
+ # Example Request:
59
+ # DELETE /v1/<%= model_name.pluralize.underscore %>/:id
60
+ params do
61
+ requires :id
62
+ end
63
+ delete ':id' do
64
+ <%= model_name.camelize.singularize %>.destroy(params[:id])
65
+ end
66
66
  end
67
67
  end
68
68
  end
@@ -11,14 +11,6 @@ describe '<%= model_name.camelize.pluralize %>' do
11
11
  it 'returns 200 success status' do
12
12
  expect(response.response_code).to eq 200
13
13
  end
14
-
15
- it 'returns a <%= model_name.underscore.singularize %>' do
16
- expect(json.length).to eq 1
17
- end
18
-
19
- it 'returns the same <%= model_name.underscore.singularize %>' do
20
- pending
21
- end
22
14
  end
23
15
  end
24
16
 
@@ -32,10 +24,6 @@ describe '<%= model_name.camelize.pluralize %>' do
32
24
  it 'returns 200 success status' do
33
25
  expect(response.response_code).to eq 200
34
26
  end
35
-
36
- it 'returns a <%= model_name.underscore.singularize %>' do
37
- pending
38
- end
39
27
  end
40
28
  end
41
29
 
@@ -48,14 +36,6 @@ describe '<%= model_name.camelize.pluralize %>' do
48
36
  it 'returns 201 success status' do
49
37
  expect(response.response_code).to eq 201
50
38
  end
51
-
52
- it 'saves the <%= model_name.underscore.singularize %>' do
53
- expect(<%= model_name.camelize.singularize %>.all.count).to eq 1
54
- end
55
-
56
- it 'saves the <%= model_name.underscore.singularize %> with correct attributes' do
57
- pending
58
- end
59
39
  end
60
40
  end
61
41
 
@@ -69,10 +49,6 @@ describe '<%= model_name.camelize.pluralize %>' do
69
49
  it 'returns 200 success status' do
70
50
  expect(response.response_code).to eq 200
71
51
  end
72
-
73
- it 'updates the <%= model_name.underscore.singularize %>' do
74
- pending
75
- end
76
52
  end
77
53
  end
78
54
 
@@ -86,10 +62,6 @@ describe '<%= model_name.camelize.pluralize %>' do
86
62
  it 'returns 200 success status' do
87
63
  expect(response.response_code).to eq 200
88
64
  end
89
-
90
- it 'deletes the <%= model_name.underscore.singularize %>' do
91
- expect(<%= model_name.camelize.singularize %>.all.count).to eq 0
92
- end
93
65
  end
94
66
  end
95
67
  end
@@ -1,44 +1,4 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe <%= model_name.camelize.singularize %> do
4
- let(:<%= model_name.underscore.singularize %>) { create(:<%= model_name.underscore.singularize %>) }
5
-
6
- context '#object' do
7
- it 'should be valid' do
8
- <%= model_name.underscore.singularize %>.should be_valid
9
- end
10
- end
11
-
12
- context '#associations' do
13
- <%- attributes.each do |attribute| -%>
14
- <%- if attribute_is_id?(attribute) -%>
15
- it { should belong_to(:<%= attribute_without_id(attribute) -%>) }
16
- <%- end -%>
17
- <%- end -%>
18
- pending
19
- end
20
-
21
- context '#values' do
22
- <%- attributes.each do |attribute| -%>
23
- <%- unless attribute_is_id?(attribute) -%>
24
- it { should respond_to(:<%= attribute_name(attribute) %>) }
25
- <%- end -%>
26
- <%- end -%>
27
- end
28
-
29
- context '#scopes' do
30
- pending
31
- end
32
-
33
- context '#validations' do
34
- pending
35
- end
36
-
37
- context '#methods' do
38
- pending
39
- end
40
-
41
- context '#callbacks' do
42
- pending
43
- end
44
4
  end
@@ -1,3 +1,3 @@
1
1
  module GrapeScaffold
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shrivara K S
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-14 00:00:00.000000000 Z
11
+ date: 2015-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -43,7 +43,7 @@ files:
43
43
  - lib/generators/grape/scaffold/templates/model_spec.erb
44
44
  - lib/grape_scaffold.rb
45
45
  - lib/grape_scaffold/version.rb
46
- homepage: https://github.com/icicletech/grape_scaffold
46
+ homepage: https://github.com/icicletech/grape-scaffold
47
47
  licenses:
48
48
  - MIT
49
49
  metadata: {}