#前提・実現したいこと
・切ったブランチ(ここでは、filling-in-layout)の内容をそのまま100%でmasterブランチへと反映させて更新したいです。
#発生している問題・エラーメッセージ
・rails testを行った際
filling-in-layoutブランチ: エラーなし
master: 以下のエラー
#該当のソースコード
ec2-user:~/environment/sample_app (master) $ rails t Running via Spring preloader in process 5749 Rack::File is deprecated, please use Rack::Files instead. Started with run options --seed 26242 FAIL["test_should_get_help", StaticPagesControllerTest, 0.10762125400015066] test_should_get_help#StaticPagesControllerTest (0.11s) <Help | Ruby on Rails Tutorial Sample App> expected but was <SampleApp>.. Expected 0 to be >= 1. test/controllers/static_pages_controller_test.rb:14:in `block in <class:StaticPagesControllerTest>' FAIL["test_should_get_about", StaticPagesControllerTest, 0.11496883000017988] test_should_get_about#StaticPagesControllerTest (0.12s) <About | Ruby on Rails Tutorial Sample App> expected but was <SampleApp>.. Expected 0 to be >= 1. test/controllers/static_pages_controller_test.rb:20:in `block in <class:StaticPagesControllerTest>' FAIL["test_should_get_contact", StaticPagesControllerTest, 0.13578479500029061] test_should_get_contact#StaticPagesControllerTest (0.14s) <Contact | Ruby on Rails Tutorial Sample App> expected but was <SampleApp>.. Expected 0 to be >= 1. test/controllers/static_pages_controller_test.rb:26:in `block in <class:StaticPagesControllerTest>' FAIL["test_should_get_home", StaticPagesControllerTest, 0.37932383899988054] test_should_get_home#StaticPagesControllerTest (0.38s) <Home | Ruby on Rails Tutorial Sample App> expected but was <SampleApp>.. Expected 0 to be >= 1. test/controllers/static_pages_controller_test.rb:8:in `block in <class:StaticPagesControllerTest>' FAIL["test_layout_links", SiteLayoutTest, 0.3902098240000669] test_layout_links#SiteLayoutTest (0.39s) <Contact | Ruby on Rails Tutorial Sample App> expected but was <SampleApp>.. Expected 0 to be >= 1. test/integration/site_layout_test.rb:13:in `block in <class:SiteLayoutTest>' 7/7: [=================================] 100% Time: 00:00:00, Time: 00:00:00 Finished in 0.39274s 7 tests, 17 assertions, 5 failures, 0 errors, 0 skips
#自分で調べたことや試したこと
⬇️打ったコマンド
$ git add -A $ git commit -m "Finish layout and routes" $ git checkout master $ git merge filling-in-layout $ rails test ↑ここでエラー
#【コミットツリーの確認】
$git log --oneline --graph --decorate * 565642c (HEAD -> modeling-users, origin/master, master) site layout change * 386abb5 (heroku/master) Finish layout and routes * fdb2221 change * 833121d change master * 559a205 finish conflict |\ | * c3cccb1 (filling-in-layout) Finish layout and routes * | 548583e Complete advanced setup * | 1063882 Finish static pages |\ \ | * | 0c9b850 (static-pages) Finish static pages | * | 4774423 (origin/static-pages) Add a Static Pages controller * | | 243f099 Add a Static Pages controller * | | 75b7e4e Add hello * | | 1d1e021 Improve the README * | | 991de88 Initialize repository | |/ |/| * | 13f1258 Finish layout and routes * | c19d09f Finish layout and r
#補足情報
【現在のレベル】
・プログラミング学習期間:3ヶ月半
・現在、Rails学習開始:1ヶ月
・HTML,CSS,JavaScript学習済み
・Ruby,Rails:Progate2周、Railsチュートリアル1周目(現在5章)
【環境】
・開発環境:AWS Cloud9
・データベース:sqlite3 version3.7.17
・ブラウザ:GoogleChrome
・Rails 6.0.2.1
情報が至らぬ可能性があります。
追記すべき情報などございましたら、言っていただきたいです。
回答お待ちしております。
#追記
(1)テストcode
→rails test:(該当のソースコードの欄に記載)
⇩controllers/static_pages_controller_test.rb
StaticPagesControllerTest
1require 'test_helper' 2 3class StaticPagesControllerTest < ActionDispatch::IntegrationTest 4 5 test "should get home" do 6 get root_path 7 assert_response :success 8 assert_select "title", "Home | Ruby on Rails Tutorial Sample App" 9 end 10 11 test "should get help" do 12 get help_path 13 assert_response :success 14 assert_select "title", "Help | Ruby on Rails Tutorial Sample App" 15 end 16 17 test "should get about" do 18 get about_path 19 assert_response :success 20 assert_select "title", "About | Ruby on Rails Tutorial Sample App" 21 end 22 23 test "should get contact" do 24 get contact_path 25 assert_response :success 26 assert_select "title", "Contact | Ruby on Rails Tutorial Sample App" 27 end 28end
⇩integration/site_layout_test.rb
sitelayouttest
1require 'test_helper' 2 3class SiteLayoutTest < ActionDispatch::IntegrationTest 4 5 test "layout links" do 6 get root_path 7 assert_template 'static_pages/home' 8 assert_select "a[href=?]", root_path, count: 2 9 assert_select "a[href=?]", help_path 10 assert_select "a[href=?]", about_path 11 assert_select "a[href=?]", contact_path 12 get contact_path 13 assert_select "title", full_title("Contact") 14 get signup_path 15 assert_select "title", full_title("Sign up") 16 end 17end
(2)git status の結果
filling-in-layoutブランチも、masterブランチも結果は同じでした。
ec2-user:~/environment/sample_app (master) $ git status On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working tree clean
(3) masterブランチと filling-in-layoutブランチの差分のファイル名の確認
$ git diff --name-only master filling-in-layout Gemfile.lock Guardfile app/assets/stylesheets/static_pages.scss app/controllers/application_controller.rb app/controllers/static_pages_controller.rb app/views/layouts/application.html.erb app/views/static_pages/....html.erb app/views/static_pages/about.html.erb app/views/static_pages/help.html.erb bin/spring config/secrets.yml db/schema.rb layout_file public/assets/.sprockets-manifest-c51a6318a50b80e2a66009ec0b9c9e8a.json public/assets/application-7441e90aaeea08ce2c76b4123cab0e756e62755c6fc9732dae8cff9bdd6bdd5d.js public/assets/application-7441e90aaeea08ce2c76b4123cab0e756e62755c6fc9732dae8cff9bdd6bdd5d.js.gz public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css.gz test/controllers/static_pages_controller_test.rb
あなたの回答
tips
プレビュー