Commit 00a43072 by liyijie

Fix auth spec template

parent 9be52c63
......@@ -52,6 +52,10 @@ class SimpleControllerGenerator < Rails::Generators::NamedBase
options.auth&.camelcase if options.auth.present?
end
def auth_singular
options.auth
end
def response_status action
case action
when 'get'
......
......@@ -18,7 +18,7 @@ RSpec.describe '<%= controller_path %>', type: :request, capture_examples: true,
before :each do
<% if auth.present? -%>
@<%= resource_singular %> = <%= auth %>.register "auth", "password"
@<%= auth_singular %> = <%= auth %>.register "auth", "password"
@auth_token = <%= auth %>.login "auth", "password"
<% end -%>
@entity_count = 5
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment