myrails 6.0.0 → 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +48 -30
- data/lib/myrails.rb +46 -122
- data/lib/myrails/modules/application_generator_actions.rb +61 -0
- data/lib/myrails/modules/application_generators.rb +80 -0
- data/lib/myrails/modules/assets.rb +28 -2
- data/lib/myrails/modules/bootstrap.rb +16 -12
- data/lib/myrails/modules/capistrano.rb +11 -6
- data/lib/myrails/modules/database_generator.rb +33 -0
- data/lib/myrails/modules/database_generator_actions.rb +18 -0
- data/lib/myrails/modules/devise.rb +11 -5
- data/lib/myrails/modules/dotenv.rb +30 -6
- data/lib/myrails/modules/draper.rb +29 -0
- data/lib/myrails/modules/engine_generator_actions.rb +117 -0
- data/lib/myrails/modules/engine_generators.rb +66 -0
- data/lib/myrails/modules/figaro.rb +18 -2
- data/lib/myrails/modules/gems.rb +7 -2
- data/lib/myrails/modules/heroku.rb +28 -9
- data/lib/myrails/modules/material.rb +23 -13
- data/lib/myrails/modules/pundit.rb +30 -6
- data/lib/myrails/modules/rails_generator_actions.rb +110 -0
- data/lib/myrails/modules/rails_generators.rb +49 -95
- data/lib/myrails/modules/rspec.rb +70 -40
- data/lib/myrails/modules/rspec_generator_actions.rb +56 -0
- data/lib/myrails/modules/rspec_generators.rb +36 -35
- data/lib/myrails/modules/ui.rb +24 -7
- data/lib/myrails/templates/rails/app/assets/javascripts/application.js +0 -4
- data/lib/myrails/templates/rails/app/controllers/controller.rb +6 -6
- data/lib/myrails/templates/rails/app/controllers/namespace_controller.rb +1 -1
- data/lib/myrails/templates/rails/app/decorators/application_decorator.rb +10 -0
- data/lib/myrails/templates/rails/app/decorators/decoration.rb +13 -0
- data/lib/myrails/templates/rails/app/helpers/application_helper.rb +0 -7
- data/lib/myrails/templates/rails/app/mailers/dev_mail_interceptor.rb +1 -1
- data/lib/myrails/templates/rails/app/models/model.rb +1 -1
- data/lib/myrails/templates/rails/app/models/namespace_model.rb +2 -2
- data/lib/myrails/templates/rails/app/policies/pundit.rb +2 -8
- data/lib/myrails/templates/rails/app/presenters/presenter.rb +5 -5
- data/lib/myrails/templates/rails/app/presenters/presenter_spec.rb +4 -4
- data/lib/myrails/templates/rails/app/views/layout/material/footer.html.haml +24 -0
- data/lib/myrails/templates/rails/config/application.example.yml +23 -23
- data/lib/myrails/templates/rails/config/initializers/sendgrid.rb +10 -0
- data/lib/myrails/templates/spec/controller.rb +37 -37
- data/lib/myrails/templates/spec/decorator_spec.rb +16 -0
- data/lib/myrails/templates/spec/factory.rb +1 -1
- data/lib/myrails/templates/spec/feature.rb +2 -2
- data/lib/myrails/templates/spec/helper.rb +1 -1
- data/lib/myrails/templates/spec/model.rb +1 -1
- data/lib/myrails/templates/spec/pundit.rb +5 -4
- data/lib/myrails/templates/spec/request.rb +27 -27
- data/lib/myrails/templates/spec/shared_example.rb +2 -2
- data/lib/myrails/templates/{rails/app/presenters/presenter_config.rb → spec/support/configs/decorator_presenter.rb} +0 -0
- data/lib/myrails/templates/ui/ui_controller.rb +1 -1
- data/lib/myrails/version.rb +1 -1
- data/myrails.gemspec +3 -3
- metadata +24 -15
- data/lib/myrails/modules/application.rb +0 -13
- data/lib/myrails/modules/database.rb +0 -15
- data/lib/myrails/modules/engine.rb +0 -107
- data/lib/myrails/modules/footnotes.rb +0 -19
- data/lib/myrails/templates/rails/app/mailers/sendgrid.rb +0 -8
@@ -1,16 +1,16 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
#
|
3
|
-
describe <%=
|
3
|
+
describe <%= @name.camelize %>Presenter do
|
4
4
|
include_behavior
|
5
5
|
|
6
|
-
let(:presenter) {<%=
|
7
|
-
let(:<%=
|
6
|
+
let(:presenter) {<%= @name.camelize %>Presenter.new(<%= @name %>, view)}
|
7
|
+
let(:<%= @name %>) {create :<%= @name %>}
|
8
8
|
|
9
9
|
it 'returns name' do
|
10
10
|
expect(presenter.name).to eq object.attribute + " " + object.attribute
|
11
11
|
end
|
12
12
|
|
13
13
|
it 'returns edit path' do
|
14
|
-
expect(presenter.edit_link).to eq link_to :Edit, edit_<%=
|
14
|
+
expect(presenter.edit_link).to eq link_to :Edit, edit_<%= @name %>_path(<%= @name %>)
|
15
15
|
end
|
16
16
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
%footer.page-footer
|
2
|
+
.container
|
3
|
+
.row
|
4
|
+
.col.l6.s12
|
5
|
+
%h5.white-text NAME
|
6
|
+
%p.grey-text.text-lighten-4 SLOGAN
|
7
|
+
.col.l4.offset-l2.s12
|
8
|
+
%h5.white-text Connect
|
9
|
+
%ul
|
10
|
+
%li
|
11
|
+
=link_to 'Contact Me', new_contact_path, class: 'grey-text text-lighten-3'
|
12
|
+
%li
|
13
|
+
=link_to :Github, 'https://www.github.com/username', class: 'grey-text text-lighten-3', target: :blank
|
14
|
+
%li
|
15
|
+
=link_to :LinkedIn, 'https://www.linkedin.com/username', class: 'grey-text text-lighten-3', target: :blank
|
16
|
+
%li
|
17
|
+
=link_to :Twitter, 'https://twitter.com/username', class: 'grey-text text-lighten-3', target: :blank
|
18
|
+
.footer-copyright
|
19
|
+
.container
|
20
|
+
© #{Date.today.year} Full Name
|
21
|
+
-# %a.grey-text.text-lighten-4.right{:href => "#!"} More Links
|
22
|
+
%br/
|
23
|
+
Version:
|
24
|
+
=ENV.fetch('VERZION')
|
@@ -3,29 +3,29 @@ DB_PASS:
|
|
3
3
|
EMAIL:
|
4
4
|
DEVISE_SECRET_KEY:
|
5
5
|
# use YAML.load(ENV['FILE_TYPES'])
|
6
|
-
FILE_TYPES:
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
6
|
+
# FILE_TYPES:
|
7
|
+
# - image/gif
|
8
|
+
# - image/jpeg
|
9
|
+
# - image/jpg
|
10
|
+
# - image/png
|
11
|
+
# - application/vnd.apple.keynote
|
12
|
+
# - application/vnd.apple.pages
|
13
|
+
# - application/vnd.apple.numbers
|
14
|
+
# - application/vnd.ms-excel
|
15
|
+
# - application/vnd.ms-powerpoint
|
16
|
+
# - application/vnd.ms-word
|
17
|
+
# - application/pdf
|
18
|
+
# - text/plain
|
19
|
+
# - application/zip
|
20
|
+
# - application/x-zip
|
21
|
+
# - application/x-zip-compressed
|
22
|
+
# # Not tested yet
|
23
|
+
# # - application/vnd.oasis.opendocument.text
|
24
|
+
# # - application/vnd.oasis.opendocument.spreadsheet
|
25
|
+
# # - application/vnd.oasis.opendocument.presentation
|
26
|
+
# # - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
27
|
+
# # - application/vnd.openxmlformats-officedocument.presentationml.presentation
|
28
|
+
# # - application/vnd.openxmlformats-officedocument.wordprocessingml.document
|
29
29
|
# - application/octet-stream
|
30
30
|
development:
|
31
31
|
DEFAULT_HOST: 'http://localhost:3000'
|
@@ -0,0 +1,10 @@
|
|
1
|
+
config.action_mailer.delivery_method = :smtp
|
2
|
+
config.action_mailer.smtp_settings = {
|
3
|
+
address: 'smtp.sendgrid.net',
|
4
|
+
port: 587,
|
5
|
+
domain: 'yourdomain.com',
|
6
|
+
user_name: 'someuser',
|
7
|
+
password: 'somepassword',
|
8
|
+
authentication: 'plain',
|
9
|
+
enable_starttls_auto: true
|
10
|
+
}
|
@@ -1,49 +1,49 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
|
-
describe <%=
|
3
|
+
describe <%= @name.pluralize.camelize %>Controller do
|
4
4
|
# let(:user) {create :user}
|
5
|
-
let(:<%=
|
6
|
-
let(:<%=
|
5
|
+
let(:<%= @name.pluralize %>) {create_list :<%= @name %>, 3 }
|
6
|
+
let(:<%= @name.singularize %>) {create :<%= @name.singularize %>}
|
7
7
|
|
8
8
|
# before {sign_in user}
|
9
9
|
|
10
10
|
describe 'GET index' do
|
11
11
|
before do
|
12
|
-
<%=
|
12
|
+
<%= @name.pluralize %>
|
13
13
|
get :index
|
14
14
|
end
|
15
15
|
|
16
|
-
subject {assigns[:<%=
|
16
|
+
subject {assigns[:<%= @name.pluralize %>]}
|
17
17
|
|
18
|
-
it {is_expected.to eq <%=
|
18
|
+
it {is_expected.to eq <%= @name.pluralize %>}
|
19
19
|
end
|
20
20
|
|
21
21
|
describe 'GET show' do
|
22
|
-
before {get :show, params: {id: <%=
|
22
|
+
before {get :show, params: {id: <%= @name.singularize %>}}
|
23
23
|
|
24
|
-
subject(:<%=
|
24
|
+
subject(:<%= @name.first %>) {assigns[:<%= @name.singularize %>]}
|
25
25
|
|
26
|
-
it {is_expected.to eq <%=
|
26
|
+
it {is_expected.to eq <%= @name.singularize %>}
|
27
27
|
end
|
28
28
|
|
29
29
|
describe 'GET new' do
|
30
30
|
before {get :new}
|
31
31
|
|
32
|
-
subject(:<%=
|
32
|
+
subject(:<%= @name.first %>) {assigns[:<%= @name.singularize %>]}
|
33
33
|
|
34
|
-
it {is_expected.to be_a_new <%=
|
34
|
+
it {is_expected.to be_a_new <%= @name.singularize.camelize %>}
|
35
35
|
end
|
36
36
|
|
37
37
|
describe 'POST create' do
|
38
38
|
context 'successful create' do
|
39
|
-
before {post :create, params: {<%=
|
39
|
+
before {post :create, params: {<%= @name.singularize %>: attributes_for(:<%= @name.singularize %>)}}
|
40
40
|
|
41
|
-
subject(:<%=
|
41
|
+
subject(:<%= @name.first %>){assigns[:<%= @name.singularize %>]}
|
42
42
|
|
43
43
|
it 'redirects to :show'
|
44
|
-
it {is_expected.to be_instance_of <%=
|
44
|
+
it {is_expected.to be_instance_of <%= @name.singularize.camelize %>}
|
45
45
|
|
46
|
-
it 'sets flash
|
46
|
+
it 'sets flash message' do
|
47
47
|
expect(flash[:success]).to_not be_nil
|
48
48
|
end
|
49
49
|
|
@@ -51,72 +51,72 @@ describe <%= options[:name].pluralize.camelize %>Controller do
|
|
51
51
|
end
|
52
52
|
|
53
53
|
context 'unsuccessful create' do
|
54
|
-
before {post :create, params: {<%=
|
54
|
+
before {post :create, params: {<%= @name.singularize %>: attributes_for(:<%= @name.singularize %>, attr: nil)}}
|
55
55
|
|
56
|
-
subject(:<%=
|
56
|
+
subject(:<%= @name.first %>){assigns[:<%= @name.singularize %>]}
|
57
57
|
|
58
58
|
it 'renders :new template'
|
59
|
-
it {is_expected.to be_a_new <%=
|
59
|
+
it {is_expected.to be_a_new <%= @name.singularize.camelize %>}
|
60
60
|
|
61
|
-
it 'sets flash
|
61
|
+
it 'sets flash message' do
|
62
62
|
expect(flash[:error]).to_not be_nil
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
67
|
describe 'GET edit' do
|
68
|
-
before {get :edit, params: {id: <%=
|
68
|
+
before {get :edit, params: {id: <%= @name.singularize %>}}
|
69
69
|
|
70
|
-
subject(:<%=
|
70
|
+
subject(:<%= @name.first %>){assigns[:<%= @name.singularize %>]}
|
71
71
|
|
72
|
-
it {is_expected.to eq <%=
|
72
|
+
it {is_expected.to eq <%= @name.singularize %>}
|
73
73
|
end
|
74
74
|
|
75
75
|
describe 'PUT/PATCH update' do
|
76
76
|
context 'successful update' do
|
77
|
-
before {put :update, params: {id: <%=
|
77
|
+
before {put :update, params: {id: <%= @name.singularize %>, <%= @name.singularize %>: attributes_for(:<%= @name.singularize %>)}}
|
78
78
|
|
79
|
-
subject(:<%=
|
79
|
+
subject(:<%= @name.first %>) {assigns[:<%= @name.singularize %>]}
|
80
80
|
|
81
81
|
it 'redirects to :show'
|
82
|
-
it {is_expected.to eq <%=
|
82
|
+
it {is_expected.to eq <%= @name.singularize %>}
|
83
83
|
|
84
|
-
it 'sets flash
|
84
|
+
it 'sets flash message' do
|
85
85
|
expect(flash[:success]).to_not be_nil
|
86
86
|
end
|
87
87
|
it 'tags current_user as updater'
|
88
88
|
end
|
89
89
|
|
90
90
|
context 'unsuccessful update' do
|
91
|
-
before {put :update, params: {id: <%=
|
91
|
+
before {put :update, params: {id: <%= @name.singularize %>, <%= @name.singularize %>: attributes_for(:<%= @name.singularize %>, attr: nil)}}
|
92
92
|
|
93
|
-
subject(:<%=
|
93
|
+
subject(:<%= @name.first %>) {assigns[:<%= @name.singularize %>]}
|
94
94
|
|
95
95
|
it 'renders :edit template'
|
96
|
-
it {is_expected.to eq <%=
|
96
|
+
it {is_expected.to eq <%= @name.singularize %>}
|
97
97
|
|
98
|
-
it 'sets flash
|
98
|
+
it 'sets flash message' do
|
99
99
|
expect(flash[:error]).to_not be_nil
|
100
100
|
end
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
104
104
|
describe 'DELETE destroy' do
|
105
|
-
before {delete :destroy, params: {id: <%=
|
105
|
+
before {delete :destroy, params: {id: <%= @name.singularize %>}}
|
106
106
|
|
107
|
-
subject(:<%=
|
107
|
+
subject(:<%= @name.first %>) {assigns[:<%= @name.singularize %>]}
|
108
108
|
|
109
109
|
it 'redirects to :index' do
|
110
|
-
expect(response).to redirect_to <%=
|
110
|
+
expect(response).to redirect_to <%= @name.pluralize %>_path
|
111
111
|
end
|
112
112
|
|
113
|
-
it {is_expected.to eq <%=
|
113
|
+
it {is_expected.to eq <%= @name.singularize %>}
|
114
114
|
|
115
|
-
it 'deletes @<%=
|
116
|
-
expect(<%=
|
115
|
+
it 'deletes @<%= @name.singularize %>' do
|
116
|
+
expect(<%= @name.singularize.camelize %>.find_by_id(<%= @name.singularize %>.id)).to be_nil
|
117
117
|
end
|
118
118
|
|
119
|
-
it 'sets flash
|
119
|
+
it 'sets flash message' do
|
120
120
|
expect(flash[:success]).to_not be_nil
|
121
121
|
end
|
122
122
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
describe <%= @name.camelize %>Decorator do
|
4
|
+
include_behavior
|
5
|
+
|
6
|
+
let(:decorator) {<%= @name.camelize %>Decorator.new(<%= @name %>, view)}
|
7
|
+
let(:<%= @name %>) {create :<%= @name %>}
|
8
|
+
|
9
|
+
it 'returns name' do
|
10
|
+
expect(decorator.name).to eq object.attribute + " " + object.attribute
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'returns edit path' do
|
14
|
+
expect(decorator.edit_link).to eq link_to :Edit, edit_<%= @name %>_path(<%= @name %>)
|
15
|
+
end
|
16
|
+
end
|
@@ -1,2 +1,2 @@
|
|
1
|
-
module <%=
|
1
|
+
module <%= @param.gsub("\s", '_').camelize %>Helper
|
2
2
|
end
|
@@ -1,9 +1,10 @@
|
|
1
1
|
# Use with Pundit Matches: https://github.com/chrisalley/pundit-matchers
|
2
2
|
require 'rails_helper'
|
3
|
-
describe <%= options[:name].camelize %>Policy do
|
4
|
-
subject { <%= options[:name].camelize %>Policy.new(user, <%= options[:name].split("/").last %>) }
|
5
3
|
|
6
|
-
|
4
|
+
describe <%= @name.camelize %>Policy do
|
5
|
+
subject { <%= @name.camelize %>Policy.new(user, <%= @name.split("/").last %>) }
|
6
|
+
|
7
|
+
let(:<%= @name.split("/").last %>) { create :<%= @name.gsub("/", "_") %> }
|
7
8
|
|
8
9
|
context 'for a visitor' do
|
9
10
|
it {is_expected.to permit_action(:new)}
|
@@ -16,7 +17,7 @@ describe <%= options[:name].camelize %>Policy do
|
|
16
17
|
|
17
18
|
context "for an admin" do
|
18
19
|
|
19
|
-
let(:user) { <%=
|
20
|
+
let(:user) { <%= @name.split("/").last %>.user }
|
20
21
|
|
21
22
|
it {is_expected.to permit_action(:new)}
|
22
23
|
it {is_expected.to permit_action(:create)}
|
@@ -1,108 +1,108 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
|
-
describe '<%=
|
3
|
+
describe '<%= @param %> api' do
|
4
4
|
let(:headers) {{"ACCEPT" => "application/json"}}
|
5
|
-
let(:<%=
|
6
|
-
let(:<%=
|
5
|
+
let(:<%= @param %>) {create :<%= @param %>}
|
6
|
+
let(:<%= @param.pluralize %>) {create_list :<%= @param %>, 3}
|
7
7
|
|
8
8
|
describe 'GET index' do
|
9
9
|
before do
|
10
|
-
<%=
|
11
|
-
get '/<%=
|
10
|
+
<%= @param.pluralize %>
|
11
|
+
get '/<%= @param.pluralize %>'
|
12
12
|
end
|
13
13
|
|
14
14
|
it 'returns success status' do
|
15
15
|
expect(response).to be_success
|
16
16
|
end
|
17
17
|
|
18
|
-
it 'sets @<%=
|
19
|
-
expect(assigns['<%=
|
18
|
+
it 'sets @<%= @param.pluralize %>' do
|
19
|
+
expect(assigns['<%= @param.pluralize %>']).to eq <%= @param.pluralize %>
|
20
20
|
end
|
21
21
|
|
22
22
|
it_behaves_like 'returns content as json' do
|
23
|
-
let(:action) {get '/<%=
|
23
|
+
let(:action) {get '/<%= @param.pluralize %>'}
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
27
|
describe 'GET show' do
|
28
|
-
before {get "/<%=
|
28
|
+
before {get "/<%= @param.pluralize %>/#{<%= @param %>.id}"}
|
29
29
|
|
30
30
|
it 'returns success status' do
|
31
31
|
expect(response).to be_success
|
32
32
|
end
|
33
33
|
|
34
34
|
it 'sets @article' do
|
35
|
-
expect(assigns[:<%=
|
35
|
+
expect(assigns[:<%= @param %>]).to eq <%= @param %>
|
36
36
|
end
|
37
37
|
|
38
38
|
it_behaves_like 'returns content as json' do
|
39
|
-
let(:action) {get "/<%=
|
39
|
+
let(:action) {get "/<%= @param.pluralize %>/#{<%= @param %>.id}"}
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
43
|
describe 'POST create' do
|
44
44
|
context 'successful' do
|
45
|
-
before {post '/<%=
|
45
|
+
before {post '/<%= @param.pluralize %>', params: {<%= @param %>: {}}, headers: headers}
|
46
46
|
|
47
47
|
it 'returns created status' do
|
48
48
|
expect(response).to have_http_status :created
|
49
49
|
end
|
50
50
|
|
51
|
-
it 'sets @<%=
|
52
|
-
expect(assigns[:<%=
|
51
|
+
it 'sets @<%= @param %>' do
|
52
|
+
expect(assigns[:<%= @param %>]).to be_instance_of <%= @param.camelize %>
|
53
53
|
end
|
54
54
|
|
55
55
|
it_behaves_like 'returns content as json' do
|
56
|
-
let(:action) {post '/<%=
|
56
|
+
let(:action) {post '/<%= @param.pluralize %>', params: {<%= @param %>: {}}, headers: headers}
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
60
|
context 'unsuccessful' do
|
61
|
-
before {post '/<%=
|
61
|
+
before {post '/<%= @param.pluralize %>', params: {<%= @param %>: {}}, headers: headers}
|
62
62
|
|
63
63
|
it 'returns unprocessable_entity status' do
|
64
64
|
expect(response).to have_http_status :unprocessable_entity
|
65
65
|
end
|
66
66
|
|
67
|
-
it 'sets @<%=
|
68
|
-
expect(assigns[:<%=
|
67
|
+
it 'sets @<%= @param %>' do
|
68
|
+
expect(assigns[:<%= @param %>]).to be_a_new <%= @param.camelize %>
|
69
69
|
end
|
70
70
|
it_behaves_like 'returns content as json' do
|
71
|
-
let(:action) {post '/<%=
|
71
|
+
let(:action) {post '/<%= @param.pluralize %>', params: {<%= @param %>: {}}, headers: headers}
|
72
72
|
end
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
76
|
describe 'PUT update' do
|
77
77
|
context 'successful' do
|
78
|
-
before {put "/<%=
|
78
|
+
before {put "/<%= @param.pluralize %>/#{<%= @param %>.id}", params: {<%= @param %>: {}}, headers: headers}
|
79
79
|
|
80
80
|
it 'returns success status' do
|
81
81
|
expect(response).to have_http_status :success
|
82
82
|
end
|
83
83
|
|
84
|
-
it 'sets @<%=
|
85
|
-
expect(assigns['<%=
|
84
|
+
it 'sets @<%= @param %>' do
|
85
|
+
expect(assigns['<%= @param %>']).to eq <%= @param %>
|
86
86
|
end
|
87
87
|
|
88
88
|
it_behaves_like 'returns content as json' do
|
89
|
-
let(:action) {put "/<%=
|
89
|
+
let(:action) {put "/<%= @param.pluralize %>/#{<%= @param %>.id}", params: {<%= @param %>: {}}}
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
93
|
context 'unsuccessful' do
|
94
|
-
before {put "/<%=
|
94
|
+
before {put "/<%= @param.pluralize %>/#{<%= @param %>.id}", params: {<%= @param %>: {}}, headers: headers}
|
95
95
|
|
96
96
|
it 'returns unprocessable_entity status' do
|
97
97
|
expect(response).to have_http_status :bad_request
|
98
98
|
end
|
99
99
|
|
100
|
-
it 'sets @<%=
|
101
|
-
expect(assigns[:<%=
|
100
|
+
it 'sets @<%= @param %>' do
|
101
|
+
expect(assigns[:<%= @param %>]).to eq <%= @param %>
|
102
102
|
end
|
103
103
|
|
104
104
|
it_behaves_like 'returns content as json' do
|
105
|
-
let(:action) {put "/<%=
|
105
|
+
let(:action) {put "/<%= @param.pluralize %>/#{<%= @param %>.id}", params: {<%= @param %>: {}}, headers: headers}
|
106
106
|
end
|
107
107
|
end
|
108
108
|
end
|