{"id":3528,"date":"2023-08-16T15:27:15","date_gmt":"2023-08-16T06:27:15","guid":{"rendered":"https:\/\/www.kinryo.net\/?p=3528"},"modified":"2023-08-16T15:27:15","modified_gmt":"2023-08-16T06:27:15","slug":"%ef%bc%96%ef%bc%9a%e5%b0%91%e3%81%97%e3%81%a0%e3%81%91%e5%8b%95%e7%9a%84%e3%81%aa%e3%83%9a%e3%83%bc%e3%82%b8","status":"publish","type":"post","link":"https:\/\/www.kinryo.net\/?p=3528","title":{"rendered":"\uff16\uff1a\u5c11\u3057\u3060\u3051\u52d5\u7684\u306a\u30da\u30fc\u30b8"},"content":{"rendered":"<p>\u30da\u30fc\u30b8\u306e\u5185\u5bb9\u306b\u5fdc\u3058\u3066\u3001\u30da\u30fc\u30b8\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u81ea\u3089\u66f8\u304d\u63db\u3048\u3066\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002\u30ec\u30a4\u30a2\u30a6\u30c8\u3082\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u4f5c\u6210\u3055\u308c\u307e\u3059\u304c\u30b3\u30d4\u30fc\u3092\u53d6\u3063\u3066\u304a\u304d\u307e\u3059<br \/><span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">mv app\/views\/layouts\/application.html.erb layout_file<br \/><\/span> <span class=\"description\">StaticPages\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u30c6\u30b9\u30c8\u3059\u308b<\/span>\u304c\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u5909\u66f4\u3059\u308b<br \/><span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">gedit test\/controllers\/static_pages_controller_test.rb<br \/><\/span> <span style=\"color: #0000ff;\">require &#8220;test_helper&#8221;<br \/><\/span> <span style=\"color: #0000ff;\">class StaticPagesControllerTest &lt; ActionDispatch::IntegrationTest<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0 test &#8220;should get home&#8221; do<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 get static_pages_home_url<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 assert_response :success<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 assert_select &#8220;title&#8221;, &#8220;Home | Ruby on Rails Tutorial Sample App&#8221;<\/span>\u3000\u2190\u8ffd\u8a18<br \/><span style=\"color: #0000ff;\">end<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0 test &#8220;should get help&#8221; do<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 get static_pages_help_url<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 assert_response :success<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 assert_select &#8220;title&#8221;, &#8220;Help | Ruby on Rails Tutorial Sample App&#8221;<\/span>\u3000\u2190\u8ffd\u8a18<br \/><span style=\"color: #0000ff;\"> end<\/span><\/p>\r\n<!-- \/wp:post-content -->\r\n\r\n<!-- wp:paragraph -->\r\n<p><span style=\"color: #0000ff;\">\u00a0test &#8220;should get about&#8221; do<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 get static_pages_about_url<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 assert_response :success<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 assert_select &#8220;title&#8221;, &#8220;About | Ruby on Rails Tutorial Sample App&#8221;<\/span>\u3000\u2190\u8ffd\u8a18 <span style=\"color: #0000ff;\">\u00a0 end<br \/><\/span> <span style=\"color: #0000ff;\">end<br \/><\/span> \u30c6\u30b9\u30c8\u3059\u308b<br \/><span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">rails test<br \/><\/span> <span style=\"color: #ff6600;\">\u524d\u7565<br \/><\/span> <span style=\"color: #ff6600;\">3) Failure:<\/span> <span style=\"color: #ff6600;\">StaticPagesControllerTest#test_should_get_help [\/Rails\/environment\/sample_app\/test\/controllers\/static_pages_controller_test.rb:13]:<\/span> <span style=\"color: #ff6600;\">Expected at least 1 element matching &#8220;title&#8221;, found 0.<\/span> <span style=\"color: #ff6600;\">Expected 0 to be &gt;= 1.<\/span> <span style=\"color: #ff6600;\">3 runs, 6 assertions, 3 failures, 0 errors, 0 skips<br \/><\/span>\uff13\u3064faileres\u304c\u51fa\u3066\u3044\u308b\u3002\u30a8\u30e9\u30fc\u306b\u2019Expected at least 1 element matching &#8220;title&#8221;, found 0&#8217;\u3068\u51fa\u3066\u3044\u308b\u3002view\u306btitle\u304c\u7121\u3044\u3068\u8a00\u3063\u3066\u3044\u308b\u306e\u3067<br \/><span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">gedit app\/views\/static_pages\/home.html.erb<br \/><\/span> <span style=\"color: #0000ff;\">&lt;!DOCTYPE html&gt;<\/span>\u3000\u3000\u2190\u3053\u3053\u304b\u3089<br \/><span style=\"color: #0000ff;\">&lt;html&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0 &lt;head&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;title&gt;Home | Ruby on Rails Tutorial Sample App&lt;\/title&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0 &lt;\/head&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0 &lt;body&gt;<\/span>\u3000\u3000\u3000\u3000\u2190\u3053\u3053\u307e\u3067\u8ffd\u8a18<br \/>\u00a0\u00a0\u00a0 <span style=\"color: #0000ff;\">&lt;h1&gt;Sample App&lt;\/h1&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;p&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 This is the home page for the<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;a href=&#8221;https:\/\/railstutorial.jp\/&#8221;&gt;Ruby on Rails Tutorial&lt;\/a&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 sample application.<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;\/p&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0 &lt;\/body&gt;\u3000<\/span>\u3000\u3000\u3000\u2190\u3053\u3053\u304b\u3089<br \/><span style=\"color: #0000ff;\">&lt;\/html&gt;<\/span>\u3000\u3000\u3000\u3000\u3000\u2190\u3053\u3053\u307e\u3067\u8ffd\u8a18<br \/>\u5143\u304b\u3089\u6709\u3063\u305f\u3082\u306e\u306b\u306f\u898b\u3084\u3059\u304f\u3059\u308b\u305f\u3081\u306b\u30a4\u30f3\u30c6\u30f3\u30c9\u304c\u5165\u3063\u3066\u3044\u308b \u540c\u69d8\u306bhelp\u3068about\u3082\u4f5c\u308b <span>app\/views\/static_pages\/help.html.erb\u306e\u5185\u5bb9<br \/><\/span><span style=\"color: #0000ff;\">&lt;!DOCTYPE html&gt;<br \/><\/span> <span style=\"color: #0000ff;\">&lt;html&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0 &lt;head&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;title&gt;Help | Ruby on Rails Tutorial Sample App&lt;\/title&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0 &lt;\/head&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0 &lt;body&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;h1&gt;Help&lt;\/h1&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;p&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 Get help on the Ruby on Rails Tutorial at the<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0 \u00a0 \u00a0 &lt;a href=&#8221;https:\/\/railstutorial.jp\/help&#8221;&gt;Rails Tutorial help<\/span> <span style=\"color: #0000ff;\">\u00a0 \u00a0 \u00a0 page&lt;\/a&gt;.<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0 \u00a0 \u00a0 To get help on this sample app, see the<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0 \u00a0\u00a0 &lt;a href=&#8221;https:\/\/railstutorial.jp\/#ebook&#8221;&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0 \u00a0 \u00a0 &lt;em&gt;Ruby on Rails Tutorial&lt;\/em&gt; book&lt;\/a&gt;.<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;\/p&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0 &lt;\/body&gt;<br \/><\/span> <span style=\"color: #0000ff;\">&lt;\/html&gt;<br \/><\/span> <span>app\/views\/static_pages\/about.html.erb\u306e\u5185\u5bb9<br \/><\/span> <span style=\"color: #0000ff;\">&lt;!DOCTYPE html&gt;<br \/><\/span> <span style=\"color: #0000ff;\">&lt;html&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0 &lt;head&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;title&gt;About | Ruby on Rails Tutorial Sample App&lt;\/title&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0 &lt;\/head&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0 &lt;body&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;h1&gt;About&lt;\/h1&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;p&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;a href=&#8221;https:\/\/railstutorial.jp\/&#8221;&gt;Ruby on Rails Tutorial&lt;\/a&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 is a &lt;a href=&#8221;https:\/\/railstutorial.jp\/#ebook&#8221;&gt;book&lt;\/a&gt; and<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;a href=&#8221;https:\/\/railstutorial.jp\/screencast&#8221;&gt;screencast&lt;\/a&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 to teach web development with<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;a href=&#8221;https:\/\/rubyonrails.org\/&#8221;&gt;Ruby on Rails&lt;\/a&gt;.<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 This is the sample app for the tutorial.<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;\/p&gt;<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0 &lt;\/body&gt;<br \/><\/span> <span style=\"color: #0000ff;\">&lt;\/html&gt;<br \/><\/span> \u672c\u6765\u306ehtml\u306f\u4e0a\u306e\u4f8b\u306e\u69d8\u306b&lt;!DOCTYPE html&gt;\u304c\u5165\u308a&lt;head&gt;\u3068&lt;body&gt;\u30bf\u30b0\u304c\u5165\u308b\u3002\u3067\u30c6\u30b9\u30c8<br \/><span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">rails test<br \/><\/span> <span style=\"color: #ff6600;\">\u524d\u7565<br \/><\/span> <span style=\"color: #ff6600;\">3 runs, 6 assertions, 0 failures, 0 errors, 0 skips<br \/><\/span> \u3053\u308c\u3067\u30a8\u30e9\u30fc\u306f\u51fa\u306a\u304f\u306a\u3063\u305f\u3002 \u73fe\u5728\u306etest\/controllers\/static_pages_controller_test.rb\u306e\u5185\u5bb9\u306f<br \/><span style=\"color: #0000ff;\">require &#8220;test_helper&#8221;<br \/><\/span> <span style=\"color: #0000ff;\">class StaticPagesControllerTest &lt; ActionDispatch::IntegrationTest<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0 test &#8220;should get home&#8221; do<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 get static_pages_home_url<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 assert_response :success<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0<span data-color=\"#fffd6b\" style=\"background: linear-gradient(transparent 60%,rgba(255, 253, 107, 0.7) 0);\" class=\"vk_highlighter\"> assert_select &#8220;title&#8221;, &#8220;Home | Ruby on Rails Tutorial Sample App&#8221;<br \/><\/span><\/span> <span style=\"color: #0000ff;\">\u00a0 end<\/span><\/p>\r\n<!-- \/wp:paragraph -->\r\n<p>&nbsp;<\/p>\r\n<p><span style=\"color: #0000ff;\">\u00a0 test &#8220;should get help&#8221; do<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 get static_pages_help_url<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 assert_response :success<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 <span data-color=\"#f8f567\" style=\"background: linear-gradient(transparent 60%,rgba(248, 245, 103, 0.7) 0);\" class=\"vk_highlighter\">assert_select &#8220;title&#8221;, &#8220;Help | Ruby on Rails Tutorial Sample App&#8221;<br \/><\/span><\/span> <span style=\"color: #0000ff;\">\u00a0 end<\/span><\/p>\r\n<p><span style=\"color: #0000ff;\">\u00a0 test &#8220;should get about&#8221; do<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 get static_pages_about_url<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 assert_response :success<br \/><\/span> <span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0<span data-color=\"#fffd6b\" style=\"background: linear-gradient(transparent 60%,rgba(255, 253, 107, 0.7) 0);\" class=\"vk_highlighter\"> assert_select &#8220;title&#8221;, &#8220;About | Ruby on Rails Tutorial Sample App&#8221;<br \/><\/span><\/span> <span style=\"color: #0000ff;\">\u00a0 end<br \/><\/span> <span style=\"color: #0000ff;\">end<br \/><\/span> \u30cf\u30a4\u30e9\u30a4\u30c8\u3057\u3066\u3044\u308b\u90e8\u5206\u304c\u540c\u3058\u3088\u3046\u306a\u7e70\u308a\u8fd4\u3057\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001setup\u3068\u8a00\u3046\u7279\u5225\u306a\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3044\u6539\u826f<br \/><mark style=\"background-color: rgba(0, 0, 0, 0); color: #ff9c00;\" class=\"has-inline-color\">$ <\/mark><mark style=\"background-color: rgba(0, 0, 0, 0); color: #2fc800;\" class=\"has-inline-color\">gedit test\/controllers\/static_pages_controller_test.rb<br \/><\/mark> <span style=\"color: #0000ff;\"><mark style=\"background-color: rgba(0, 0, 0, 0);\" class=\"has-inline-color has-blue-color\">require &#8220;test_helper&#8221;<br \/><\/mark> <mark style=\"background-color: rgba(0, 0, 0, 0);\" class=\"has-inline-color has-blue-color\">class StaticPagesControllerTest &lt; ActionDispatch::IntegrationTest<br \/>\u00a0\u00a0 <\/mark><mark style=\"background-color: rgba(0, 0, 0, 0);\" class=\"has-inline-color has-blue-color\">def setup<\/mark>\u3000<\/span>\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u2190\u3053\u3053\u304b\u3089<br \/><span style=\"color: #0000ff;\"><mark style=\"background-color: rgba(0, 0, 0, 0);\" class=\"has-inline-color has-blue-color\">\u00a0\u00a0\u00a0 @base_title = &#8220;Ruby on Rails Tutorial Sample App&#8221;<br \/>\u00a0 end<\/mark><\/span>\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u2190\u3053\u3053\u307e\u3067\u8ffd\u8a18<br \/><mark style=\"background-color: rgba(0, 0, 0, 0);\" class=\"has-inline-color has-blue-color\">\u00a0 test &#8220;should get home&#8221; do<br \/>\u00a0\u00a0\u00a0 <\/mark><mark style=\"background-color: rgba(0, 0, 0, 0);\" class=\"has-inline-color has-blue-color\">get static_pages_home_url<br \/>\u00a0\u00a0\u00a0 assert_response :success<br \/>\u00a0\u00a0\u00a0 <\/mark><mark style=\"background-color: rgba(0, 0, 0, 0);\" class=\"has-inline-color has-blue-color\">assert_select &#8220;title&#8221;, &#8220;Home | #{@base_title}&#8221;<\/mark>\u3000\u3000\u2190\u5909\u66f4<br \/><mark style=\"background-color: rgba(0, 0, 0, 0);\" class=\"has-inline-color has-blue-color\">\u00a0 end<br \/><\/mark> <mark style=\"background-color: rgba(0, 0, 0, 0);\" class=\"has-inline-color has-blue-color\">\u00a0 test &#8220;should get help&#8221; do<br \/>\u00a0\u00a0\u00a0 get static_pages_help_url<br \/>\u00a0\u00a0\u00a0 assert_response :success<br \/>\u00a0\u00a0\u00a0 <\/mark><mark style=\"background-color: rgba(0, 0, 0, 0);\" class=\"has-inline-color has-blue-color\">assert_select &#8220;title&#8221;, &#8220;Help | #{@base_title}&#8221;<\/mark>\u3000\u3000\u2190\u5909\u66f4<br \/><mark style=\"background-color: rgba(0, 0, 0, 0);\" class=\"has-inline-color has-blue-color\">\u00a0 end<br \/><\/mark><mark style=\"background-color: rgba(0, 0, 0, 0);\" class=\"has-inline-color has-blue-color\">\u00a0 test &#8220;should get about&#8221; do<br \/>\u00a0\u00a0\u00a0 get static_pages_about_url<br \/>\u00a0\u00a0\u00a0 <\/mark><mark style=\"background-color: rgba(0, 0, 0, 0);\" class=\"has-inline-color has-blue-color\">assert_response :success<br \/>\u00a0\u00a0\u00a0 assert_select &#8220;title&#8221;, &#8220;About | #{@base_title}&#8221;<\/mark>\u3000\u3000\u2190\u5909\u66f4<br \/><mark style=\"background-color: rgba(0, 0, 0, 0);\" class=\"has-inline-color has-blue-color\">\u00a0 end<br \/>end<br \/><\/mark> \u307e\u3060\u91cd\u8907\u3057\u3066\u3044\u308b\u304c\u3001\u5b8c\u5168\u306b\u540c\u3058\u3067\u306f\u5185\u304c\u3001Rails\u306e<code>provide<\/code>\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u30bf\u30a4\u30c8\u30eb\u3092\u30da\u30fc\u30b8\u3054\u3068\u306b\u5909\u66f4\u3057\u3001\u306a\u308b\u3079\u304f\u540c\u3058\u3088\u3046\u306b\u3057\u307e\u3059\u3002<br \/><span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">gedit app\/views\/static_pages\/home.html.erb<\/span><br \/><span style=\"color: #0000ff;\">&lt;% provide(:title, &#8220;Home&#8221;) %&gt;<\/span>\u3000\u3000\u2190\u8ffd\u8a18<br \/><span style=\"color: #0000ff;\">&lt;!DOCTYPE html&gt;<\/span><br \/><span style=\"color: #0000ff;\">&lt;html&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 &lt;head&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;title&gt;&lt;%= yield(:title) %&gt; | Ruby on Rails Tutorial Sample App&lt;\/title&gt;<\/span>\u3000\u2190\u5909\u66f4<br \/>\u00a0<span style=\"color: #0000ff;\"> &lt;\/head&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 &lt;body&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;h1&gt;Sample App&lt;\/h1&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;p&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 This is the home page for the<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;a href=&#8221;https:\/\/railstutorial.jp\/&#8221;&gt;Ruby on Rails Tutorial&lt;\/a&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 sample application.<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;\/p&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 &lt;\/body&gt;<\/span><br \/><span style=\"color: #0000ff;\">&lt;\/html&gt;<\/span><\/p>\r\n<p>\u30c6\u30b9\u30c8\u3059\u308b<br \/><span style=\"color: #0000ff;\"><\/span><span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">rails test<\/span><br \/><span style=\"color: #ff6600;\">\u524d\u7565<\/span><br \/><span style=\"color: #ff6600;\">3 runs, 6 assertions, 0 failures, 0 errors, 0 skips<\/span><br \/>\u30a8\u30e9\u30fc\u306f\u51fa\u3066\u3044\u306a\u3044\u3002Help\u30da\u30fc\u30b8\u3068About\u30da\u30fc\u30b8\u3082\u540c\u69d8\u306b\u5909\u66f4\u3057\u307e\u3059<br \/><span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">gedit app\/views\/static_pages\/help.html.erb<\/span><br \/><span style=\"color: #0000ff;\">&lt;% provide(:title, &#8220;Help&#8221;) %&gt;<\/span>\u3000\u3000\u3000\u2190\u8ffd\u8a18<br \/><span style=\"color: #0000ff;\">&lt;!DOCTYPE html&gt;<\/span><br \/><span style=\"color: #0000ff;\">&lt;html&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 &lt;head&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;title&gt;&lt;%= yield(:title) %&gt; | Ruby on Rails Tutorial Sample App&lt;\/title&gt;<\/span>\u3000\u3000\u2190\u5909\u66f4<br \/>\u00a0<span style=\"color: #0000ff;\"> &lt;\/head&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 &lt;body&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;h1&gt;Help&lt;\/h1&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;p&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 Get help on the Ruby on Rails Tutorial at the<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;a href=&#8221;https:\/\/railstutorial.jp\/help&#8221;&gt;Rails Tutorial help<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 page&lt;\/a&gt;.<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 To get help on this sample app, see the<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;a href=&#8221;https:\/\/railstutorial.jp\/#ebook&#8221;&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;em&gt;Ruby on Rails Tutorial&lt;\/em&gt; book&lt;\/a&gt;.<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;\/p&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 &lt;\/body&gt;<\/span><br \/><span style=\"color: #0000ff;\">&lt;\/html&gt;<\/span><br \/><span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">gedit app\/views\/static_pages\/about.html.erb<\/span><br \/><span style=\"color: #0000ff;\">&lt;% provide(:title, &#8220;About&#8221;) %&gt;<\/span>\u3000\u3000\u3000\u2190\u8ffd\u8a18<br \/><span style=\"color: #0000ff;\">&lt;!DOCTYPE html&gt;<\/span><br \/><span style=\"color: #0000ff;\">&lt;html&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 &lt;head&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;title&gt;&lt;%= yield(:title) %&gt; | Ruby on Rails Tutorial Sample App&lt;\/title&gt;<\/span>\u3000\u3000\u2190\u5909\u66f4<br \/>\u00a0 <span style=\"color: #0000ff;\">&lt;\/head&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 &lt;body&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;h1&gt;About&lt;\/h1&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;p&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;a href=&#8221;https:\/\/railstutorial.jp\/&#8221;&gt;Ruby on Rails Tutorial&lt;\/a&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 is a &lt;a href=&#8221;https:\/\/railstutorial.jp\/#ebook&#8221;&gt;book&lt;\/a&gt; and<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;a href=&#8221;https:\/\/railstutorial.jp\/screencast&#8221;&gt;screencast&lt;\/a&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 to teach web development with<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;a href=&#8221;https:\/\/rubyonrails.org\/&#8221;&gt;Ruby on Rails&lt;\/a&gt;.<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0\u00a0 This is the sample app for the tutorial.<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;\/p&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 &lt;\/body&gt;<\/span><br \/><span style=\"color: #0000ff;\">&lt;\/html&gt;<\/span><br \/>\u5909\u66f4\u3057\u3066\u3044\u305f\u30ec\u30a4\u30a2\u30a6\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u5143\u306b\u623b\u3059<br \/><span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">mv layout_file app\/views\/layouts\/application.html.erb<\/span><br \/>\u30ec\u30a4\u30a2\u30a6\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u5909\u66f4\u3059\u308b<br \/><span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">gedit app\/views\/layouts\/application.html.er<\/span>b<br \/><span style=\"color: #0000ff;\">&lt;!DOCTYPE html&gt;<\/span><br \/><span style=\"color: #0000ff;\">&lt;html&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 &lt;head&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;title&gt;&lt;%= yield(:title) %&gt; | Ruby on Rails Tutorial Sample App&lt;\/title&gt;<\/span>\u3000\u3000\u2190\u5909\u66f4<br \/>\u00a0\u00a0\u00a0 <span style=\"color: #0000ff;\">&lt;meta name=&#8221;viewport&#8221; content=&#8221;width=device-width,initial-scale=1&#8243;&gt;<\/span>\u3000\u3000\u2190\u5909\u66f4<br \/>\u00a0\u00a0\u00a0 <span style=\"color: #0000ff;\">&lt;meta charset=&#8221;utf-8&#8243;&gt;<\/span>\u3000\u3000\u2190\u5909\u66f4<br \/>\u00a0\u00a0\u00a0 <span style=\"color: #0000ff;\">&lt;%= csrf_meta_tags %&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;%= csp_meta_tag %&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;%= stylesheet_link_tag &#8220;application&#8221;, &#8220;data-turbo-track&#8221;: &#8220;reload&#8221; %&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 &lt;\/head&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 &lt;body&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0\u00a0 &lt;%= yield %&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 &lt;\/body&gt;<\/span><br \/><span style=\"color: #0000ff;\">&lt;\/html&gt;<\/span><br \/>\u3053\u3053\u306b\u51fa\u3066\u304d\u305f\u3001&lt;%= yield %&gt;\u3001&lt;%= csrf_meta_tags %&gt;\u3001&lt;%= csp_meta_tag %&gt;\u3001&lt;%= stylesheet_link_tag &#8220;application&#8221;, &#8220;data-turbo-track&#8221;: &#8220;reload&#8221; %&gt; \u7b49\u306f\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u898b\u3066\u7406\u89e3\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\u305d\u3057\u3066\u30c6\u30b9\u30c8<br \/><span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">rails test<\/span><br \/><span style=\"color: #ff6600;\">\u524d\u7565<\/span><br \/><span style=\"color: #ff6600;\">3 runs, 6 assertions, 0 failures, 0 errors, 0 skips<\/span><\/p>\r\n<p>localhost:3000\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u3089hoe\u3092\u8868\u793a\u3059\u308b\u69d8\u306b\u3059\u308b<br \/><span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">gedit config\/routes.rb<\/span><br \/><span style=\"color: #0000ff;\">Rails.application.routes.draw do<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 root &#8220;static_pages#home&#8221;<\/span>\u3000\u3000\u3000\u2190\u8ffd\u8a18<br \/>\u00a0 <span style=\"color: #0000ff;\">get &#8216;static_pages\/home&#8217;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 get &#8216;static_pages\/help&#8217;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 get &#8220;static_pages\/about&#8221;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 get &#8220;static_pages\/contact&#8221;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0<del> <span class=\"n\">root<\/span> <\/del><\/span><span class=\"s2\"><span style=\"color: #0000ff;\"><del>&#8220;application#hello&#8221;<\/del><\/span>\u3000\u3000\u3000\u2190\u524a\u9664\u3059\u308b<br \/><\/span><span style=\"color: #0000ff;\">end<\/span><br \/>\u30d6\u30e9\u30a6\u30b6\u3067http:\/\/localhost:3000\/\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b<br \/>\u00a0<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.kinryo.net\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-16-13-48-27.png\" alt=\"\" class=\"alignnone size-full wp-image-3552\" width=\"560\" height=\"279\" srcset=\"https:\/\/www.kinryo.net\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-16-13-48-27.png 560w, https:\/\/www.kinryo.net\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-16-13-48-27-300x149.png 300w, https:\/\/www.kinryo.net\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-16-13-48-27-150x75.png 150w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><br \/>get\u306b\u767b\u9332<br \/><span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">git add -A<\/span><br \/><span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">git commit -m &#8220;Latest&#8221;<\/span><br \/><br \/><em>minitest reporters<\/em>\u3092\u4f7f\u3046\u3068\u30c6\u30b9\u30c8\u7d50\u679c\u306e\u51fa\u529b\u3092\u898b\u3084\u3059\u304f\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3057\u3066\u304f\u308c\u307e\u3059\u3002\u305d\u306e\u305f\u3081<br \/><span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">gedit <\/span><span class=\"description\"><span style=\"color: #008000;\">test\/test_helper.rb<\/span><br \/><\/span><span style=\"color: #0000ff;\">ENV[&#8220;RAILS_ENV&#8221;] ||= &#8220;test&#8221;<\/span><br \/><span style=\"color: #0000ff;\">require_relative &#8220;..\/config\/environment&#8221;<\/span><br \/><span style=\"color: #0000ff;\">require &#8220;rails\/test_help&#8221;<\/span><br \/><span style=\"color: #0000ff;\">require &#8220;minitest\/reporters&#8221;<\/span>\u3000\u3000\u3000\u2190\u8ffd\u8a18<br \/><span style=\"color: #0000ff;\">Minitest::Reporters.use!<\/span>\u3000\u3000\u3000\u00a0\u00a0 \u3000\u2190\u8ffd\u8a18<\/p>\r\n<p><span style=\"color: #0000ff;\">class ActiveSupport::TestCase<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 # Run tests in parallel with specified workers<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 parallelize(workers: :number_of_processors)<\/span><\/p>\r\n<p><span style=\"color: #0000ff;\">\u00a0 # Setup all fixtures in test\/fixtures\/*.yml for all tests in alphabetical order.<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 fixtures :all<\/span><\/p>\r\n<p><span style=\"color: #0000ff;\">\u00a0 # Add more helper methods to be used by all tests here&#8230;<\/span><br \/><span style=\"color: #0000ff;\">end<\/span><br \/><span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">rails test<\/span><br \/>Running 5 tests in a single process (parallelization threshold is 50)<br \/>Started with run options &#8211;seed 58624<\/p>\r\n<p>5\/5: [<span style=\"color: #008000;\">==================================<\/span>=] 100% Time: 00:00:00, Time: 00:00:00<\/p>\r\n<p>Finished in 0.27512s<br \/>5 tests, 9 assertions,<span style=\"color: #008000;\"> 0 failures, 0 errors,<\/span><span style=\"color: #d6ac04;\"> 0 skips<\/span><\/p>\r\n<h3>\u30c1\u30e5\u30fc\u3068\u30ea\u30eb\u3067\u306fGuard\u306b\u3088\u308b\u30c6\u30b9\u30c8\u306e\u81ea\u52d5\u5316\u3092\u884c\u3063\u3066\u964d\u308a\u307e\u3059\u304c\u3001\u79c1\u306f\u98db\u3070\u3057\u307e\u3057\u305f\uff08\u8a2d\u5b9a\u304c\u826f\u304f\u308f\u304b\u3089\u306a\u3044\u306e\u3067\u3001\u5f8c\u65e5\u52c9\u5f37\u3068\u3057\u307e\u3059\uff09<\/h3>\r\n<p><span class=\"description\">\u00a0<\/span><\/p>","protected":false},"excerpt":{"rendered":"<p>\u30da\u30fc\u30b8\u306e\u5185\u5bb9\u306b\u5fdc\u3058\u3066\u3001\u30da\u30fc\u30b8\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u81ea\u3089\u66f8\u304d\u63db\u3048\u3066\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002\u30ec\u30a4\u30a2\u30a6\u30c8\u3082\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u4f5c\u6210\u3055\u308c\u307e\u3059\u304c\u30b3\u30d4\u30fc\u3092\u53d6\u3063\u3066\u304a\u304d\u307e\u3059$ mv app\/views\/layouts\/application.html.er &hellip; <a href=\"https:\/\/www.kinryo.net\/?p=3528\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"vkexunit_cta_each_option":"","footnotes":""},"categories":[28],"tags":[],"class_list":["post-3528","post","type-post","status-publish","format-standard","hentry","category-ruby-on-rails-almalinux9"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/posts\/3528","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3528"}],"version-history":[{"count":23,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/posts\/3528\/revisions"}],"predecessor-version":[{"id":3553,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/posts\/3528\/revisions\/3553"}],"wp:attachment":[{"href":"https:\/\/www.kinryo.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}