forked from rails/rails
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request rails#49986 from seanpdoyle/action-view-bug-report…
…-templates Add `actionview` bug report template
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# frozen_string_literal: true | ||
|
||
require "bundler/inline" | ||
|
||
gemfile(true) do | ||
source "https://rubygems.org" | ||
|
||
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | ||
|
||
gem "rails" | ||
# If you want to test against edge Rails replace the previous line with this: | ||
# gem "rails", github: "rails/rails", branch: "main" | ||
end | ||
|
||
require "minitest/autorun" | ||
require "action_view" | ||
|
||
class BugTest < ActionView::TestCase | ||
helper do | ||
def upcase(value) | ||
value.upcase | ||
end | ||
end | ||
|
||
def test_stuff | ||
render inline: <<~ERB, locals: { key: "value" } | ||
<p><%= upcase(key) %></p> | ||
ERB | ||
|
||
element = rendered.html.at("p") | ||
|
||
assert_equal element.text, "VALUE" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters