Created
March 9, 2019 02:44
-
-
Save simi/bad8f02cd8975164a406e7a97db5cf44 to your computer and use it in GitHub Desktop.
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
after_bundle do | |
generate(:controller, 'home index', '--no-javascripts --no-stylesheets --no-helper') | |
remove_file 'app/views/home/index.html.erb' | |
create_file 'app/views/home/index.html.erb', <<-RUBY.chomp | |
<script>document.write('<h2>Hello from JS</h2>')</script> | |
RUBY | |
create_file 'test/system/home_test.rb', <<-RUBY.chomp | |
require "application_system_test_case" | |
class HomeTest < ApplicationSystemTestCase | |
test "visiting the index" do | |
visit "home/index" | |
assert_selector "h2", text: "Hello from JS" | |
end | |
end | |
RUBY | |
git :init | |
git add: '.' | |
git commit: "-a -m 'Initial commit'" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment