Skip to content

Commit

Permalink
Merge pull request #11967 from jetthoughts/add_action_controller_bug_…
Browse files Browse the repository at this point in the history
…report_template

Added bug report template for ActionController
  • Loading branch information
rafaelfranca committed Aug 22, 2013
2 parents 56c3da8 + 9d9254f commit c91f06d
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 4 deletions.
42 changes: 42 additions & 0 deletions guides/bug_report_templates/action_controller_gem.rb
@@ -0,0 +1,42 @@
# Activate the gem you are reporting the issue against.
gem 'rails', '4.0.0'

require 'rails'
require 'action_controller/railtie'

class TestApp < Rails::Application
config.root = File.dirname(__FILE__)
config.session_store :cookie_store, key: 'cookie_store_key'
config.secret_token = 'secret_token'
config.secret_key_base = 'secret_key_base'

config.logger = Logger.new($stdout)
Rails.logger = config.logger

routes.draw do
get '/' => 'test#index'
end
end

class TestController < ActionController::Base
def index
render text: 'Home'
end
end

require 'minitest/autorun'
require 'rack/test'

class BugTest < MiniTest::Unit::TestCase
include Rack::Test::Methods

def test_returns_success
get '/'
assert last_response.ok?
end

private
def app
Rails.application
end
end
51 changes: 51 additions & 0 deletions guides/bug_report_templates/action_controller_master.rb
@@ -0,0 +1,51 @@
unless File.exists?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
GEMFILE

system 'bundle'
end

require 'bundler'
Bundler.setup(:default)

require 'rails'
require 'action_controller/railtie'

class TestApp < Rails::Application
config.root = File.dirname(__FILE__)
config.session_store :cookie_store, key: 'cookie_store_key'
config.secret_token = 'secret_token'
config.secret_key_base = 'secret_key_base'

config.logger = Logger.new($stdout)
Rails.logger = config.logger

routes.draw do
get '/' => 'test#index'
end
end

class TestController < ActionController::Base
def index
render text: 'Home'
end
end

require 'minitest/autorun'
require 'rack/test'

class BugTest < Minitest::Test
include Rack::Test::Methods

def test_returns_success
get '/'
assert last_response.ok?
end

private
def app
Rails.application
end
end
10 changes: 6 additions & 4 deletions guides/source/contributing_to_ruby_on_rails.md
Expand Up @@ -30,12 +30,14 @@ At the minimum, your issue report needs a title and descriptive text. But that's

Then, don't get your hopes up! Unless you have a "Code Red, Mission Critical, the World is Coming to an End" kind of bug, you're creating this issue report in the hope that others with the same problem will be able to collaborate with you on solving it. Do not expect that the issue report will automatically see any activity or that others will jump to fix it. Creating an issue like this is mostly to help yourself start on the path of fixing the problem and for others to confirm it with an "I'm having this problem too" comment.

### Create a Self-Contained gist for Active Record Issues
### Create a Self-Contained gist for Active Record and Action Controller Issues

If you are filing a bug report for Active Record, please use
[this template for gems](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_gem.rb)
If you are filing a bug report, please use
[Active Record template for gems](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_gem.rb) or
[Action Controller template for gems](https://github.com/rails/rails/blob/master/guides/bug_report_templates/action_controller_gem.rb)
if the bug is found in a published gem, and
[this template for master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_master.rb)
[Active Record template for master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_master.rb) or
[Action Controller template for master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/action_controller_master.rb)
if the bug happens in the master branch.

### Special Treatment for Security Issues
Expand Down

0 comments on commit c91f06d

Please sign in to comment.