pragma-rails 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +2 -0
- data/CHANGELOG.md +8 -1
- data/lib/generators/pragma/resource_generator.rb +8 -0
- data/lib/generators/pragma/templates/resource/spec.rb.tt +9 -9
- data/lib/pragma/rails/version.rb +1 -1
- data/pragma-rails.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a548529aa67d6c5aaaf15602352b826b582199d3b8d394f7e93c5c56bf11fa21
|
4
|
+
data.tar.gz: 2120108c5a744376010475acb19b4df95eaebdd6a423b73dccb373d16f09bd99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b37bbe8992df14b2931a747d9b8d14c5ba78da2b33b9ec942eb9c5e6a8cd658267d748936dde6ac6e410595e663898d734e30b1f1507d37a13a30891ed5350e
|
7
|
+
data.tar.gz: bcdd84367813babc076039c5f3f9b061db5a3b178a3186b2bad9c3a55a2473c00a993be3d78773aca2ab0bb48114af199ce444f5fa49e7c3276732624a2d780e
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [2.1.1]
|
11
|
+
|
12
|
+
### Fixed
|
13
|
+
|
14
|
+
- Fixed generated specs in namespaced engines
|
15
|
+
|
10
16
|
## [2.1.0]
|
11
17
|
|
12
18
|
### Added
|
@@ -25,6 +31,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
25
31
|
|
26
32
|
First Pragma 2 release.
|
27
33
|
|
28
|
-
[Unreleased]: https://github.com/pragmarb/pragma-rails/compare/v2.1.
|
34
|
+
[Unreleased]: https://github.com/pragmarb/pragma-rails/compare/v2.1.1...HEAD
|
35
|
+
[2.1.1]: https://github.com/pragmarb/pragma-rails/compare/v2.1.0...v2.1.1
|
29
36
|
[2.1.0]: https://github.com/pragmarb/pragma-rails/compare/v2.0.0...v2.1.0
|
30
37
|
[2.0.0]: https://github.com/pragmarb/pragma-rails/compare/v1.2.4...v2.0.0
|
@@ -15,6 +15,14 @@ module Pragma
|
|
15
15
|
|
16
16
|
private
|
17
17
|
|
18
|
+
def factory_name
|
19
|
+
[namespace, class_name].join.underscore.gsub('/', '_')
|
20
|
+
end
|
21
|
+
|
22
|
+
def full_class_name
|
23
|
+
[namespace, class_name].map(&:to_s).join('::')
|
24
|
+
end
|
25
|
+
|
18
26
|
def namespaced_path
|
19
27
|
namespaced? ? super : ''
|
20
28
|
end
|
@@ -2,7 +2,7 @@ RSpec.describe '/api/v1/<%= file_name.pluralize.tr('_', '-') %>' do
|
|
2
2
|
describe 'GET /' do
|
3
3
|
subject { -> { get api_v1_<%= file_name.pluralize %>_path } }
|
4
4
|
|
5
|
-
let!(:<%= file_name %>) { create(:<%=
|
5
|
+
let!(:<%= file_name %>) { create(:<%= factory_name %>) }
|
6
6
|
|
7
7
|
it 'responds with 200 OK' do
|
8
8
|
subject.call
|
@@ -11,7 +11,7 @@ RSpec.describe '/api/v1/<%= file_name.pluralize.tr('_', '-') %>' do
|
|
11
11
|
|
12
12
|
it 'responds with the <%= file_name.pluralize.humanize.downcase %>' do
|
13
13
|
subject.call
|
14
|
-
expect(parsed_response).to match_array([
|
14
|
+
expect(parsed_response['data']).to match_array([
|
15
15
|
a_hash_including('id' => <%= file_name %>.id)
|
16
16
|
])
|
17
17
|
end
|
@@ -20,7 +20,7 @@ RSpec.describe '/api/v1/<%= file_name.pluralize.tr('_', '-') %>' do
|
|
20
20
|
describe 'GET /:id' do
|
21
21
|
subject { -> { get api_v1_<%= file_name %>_path(<%= file_name %>) } }
|
22
22
|
|
23
|
-
let!(:<%= file_name %>) { create(:<%=
|
23
|
+
let!(:<%= file_name %>) { create(:<%= factory_name %>) }
|
24
24
|
|
25
25
|
it 'responds with 200 OK' do
|
26
26
|
subject.call
|
@@ -38,7 +38,7 @@ RSpec.describe '/api/v1/<%= file_name.pluralize.tr('_', '-') %>' do
|
|
38
38
|
describe 'POST /' do
|
39
39
|
subject { -> { post api_v1_<%= file_name.pluralize %>_path, <%= file_name %>.to_json } }
|
40
40
|
|
41
|
-
let(:<%= file_name %>) { attributes_for(:<%=
|
41
|
+
let(:<%= file_name %>) { attributes_for(:<%= factory_name %>) }
|
42
42
|
|
43
43
|
it 'responds with 201 Created' do
|
44
44
|
subject.call
|
@@ -46,7 +46,7 @@ RSpec.describe '/api/v1/<%= file_name.pluralize.tr('_', '-') %>' do
|
|
46
46
|
end
|
47
47
|
|
48
48
|
it 'creates a new <%= file_name.humanize.downcase %>' do
|
49
|
-
expect(subject).to change(<%=
|
49
|
+
expect(subject).to change(<%= full_class_name %>, :count).by(1)
|
50
50
|
end
|
51
51
|
|
52
52
|
it 'responds with the new <%= file_name.humanize.downcase %>' do
|
@@ -63,8 +63,8 @@ RSpec.describe '/api/v1/<%= file_name.pluralize.tr('_', '-') %>' do
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
-
let!(:<%= file_name %>) { create(:<%=
|
67
|
-
let(:new_<%= file_name %>) { attributes_for(:<%=
|
66
|
+
let!(:<%= file_name %>) { create(:<%= factory_name %>) }
|
67
|
+
let(:new_<%= file_name %>) { attributes_for(:<%= factory_name %>) }
|
68
68
|
|
69
69
|
it 'responds with 200 OK' do
|
70
70
|
subject.call
|
@@ -85,10 +85,10 @@ RSpec.describe '/api/v1/<%= file_name.pluralize.tr('_', '-') %>' do
|
|
85
85
|
describe 'DELETE /:id' do
|
86
86
|
subject { -> { delete api_v1_<%= file_name %>_path(<%= file_name %>) } }
|
87
87
|
|
88
|
-
let!(:<%= file_name %>) { create(:<%=
|
88
|
+
let!(:<%= file_name %>) { create(:<%= factory_name %>) }
|
89
89
|
|
90
90
|
it 'deletes the <%= file_name.humanize.downcase %>' do
|
91
|
-
expect(subject).to change(<%=
|
91
|
+
expect(subject).to change(<%= full_class_name %>, :count).by(-1)
|
92
92
|
end
|
93
93
|
|
94
94
|
it 'responds with 204 No Content' do
|
data/lib/pragma/rails/version.rb
CHANGED
data/pragma-rails.gemspec
CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_development_dependency 'capybara'
|
29
29
|
spec.add_development_dependency 'coveralls'
|
30
30
|
spec.add_development_dependency 'database_cleaner'
|
31
|
-
spec.add_development_dependency '
|
31
|
+
spec.add_development_dependency 'factory_bot_rails'
|
32
32
|
spec.add_development_dependency 'faker'
|
33
33
|
spec.add_development_dependency 'pry-rails'
|
34
34
|
spec.add_development_dependency 'rake'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pragma-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alessandro Desantis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pragma
|
@@ -101,7 +101,7 @@ dependencies:
|
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0'
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
|
-
name:
|
104
|
+
name: factory_bot_rails
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
107
|
- - ">="
|
@@ -269,7 +269,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
269
269
|
version: '0'
|
270
270
|
requirements: []
|
271
271
|
rubyforge_project:
|
272
|
-
rubygems_version: 2.
|
272
|
+
rubygems_version: 2.7.5
|
273
273
|
signing_key:
|
274
274
|
specification_version: 4
|
275
275
|
summary: Ruby on Rails integration for the Pragma architecture.
|