Skip to content

Commit

Permalink
Merge pull request #2399 from ThHareau/feat/ticket-2375
Browse files Browse the repository at this point in the history
Improve controller template when no action
  • Loading branch information
pirj committed Oct 31, 2020
2 parents ed75485 + 14ed3ca commit ea09924
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/generators/rspec/controller/templates/request_spec.rb
@@ -1,7 +1,12 @@
require 'rails_helper'

RSpec.describe "<%= class_name.pluralize %>", <%= type_metatag(:request) %> do
<% namespaced_path = regular_class_path.join('/') %>
<% namespaced_path = regular_class_path.join('/') -%>
<% if actions.empty? -%>
describe "GET /index" do
pending "add some examples (or delete) #{__FILE__}"
end
<% end -%>
<% for action in actions -%>
describe "GET /<%= action %>" do
it "returns http success" do
Expand Down
Expand Up @@ -17,6 +17,7 @@
it { is_expected.to exist }
it { is_expected.to contain(/require 'rails_helper'/) }
it { is_expected.to contain(/^RSpec.describe "Posts", #{type_metatag(:request)}/) }
it { is_expected.to contain('pending') }
end
end

Expand Down

0 comments on commit ea09924

Please sign in to comment.