blowmage/minitest-rails

View on GitHub
lib/generators/minitest/controller/templates/functional_spec.rb.tt

Summary

Maintainability
Test Coverage
require "test_helper"

<% module_namespacing do -%>
describe <%= class_name %>Controller do
<% if mountable_engine? -%>
  include Engine.routes.url_helpers

<% end -%>
<% if actions.empty? -%>
  # it "does a thing" do
  #   <%= spec_expectation_monad %>(1+1).must_equal 2
  # end
<% else -%>
<% actions.each do |action| -%>
  it "must get <%= action %>" do
    get <%= url_helper_prefix %>_<%= action %>_url
    must_respond_with :success
  end

<% end -%>
<% end -%>
end
<% end -%>