houdini/lib/templates/rspec/controller/request_spec.rb.tt

19 lines
610 B
Text
Raw Normal View History

2020-05-01 19:28:55 +00:00
# frozen_string_literal: true
2020-06-12 20:03:43 +00:00
# License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
2020-05-01 19:28:55 +00:00
require 'rails_helper'
RSpec.describe "<%= class_name.pluralize %>", <%= type_metatag(:request) %> do
<% namespaced_path = regular_class_path.join('/') %>
<% for action in actions -%>
describe "GET /<%= action %>" do
it "returns http success" do
get "<%= "/#{namespaced_path}" if namespaced_path != '' %>/<%= file_name %>/<%= action %>"
expect(response).to have_http_status(:success)
end
end
<% end -%>
end