質問するログイン新規登録

質問編集履歴

3

追記

2020/01/15 08:51

投稿

babi-0105
babi-0105

スコア10

title CHANGED
File without changes
body CHANGED
@@ -174,4 +174,29 @@
174
174
  Your branch is up-to-date with 'origin/master'.
175
175
 
176
176
  nothing to commit, working tree clean
177
+ ```
178
+
179
+ (3) masterブランチと filling-in-layoutブランチの差分のファイル名の確認
180
+ ```
181
+ $ git diff --name-only master filling-in-layout
182
+
183
+ Gemfile.lock
184
+ Guardfile
185
+ app/assets/stylesheets/static_pages.scss
186
+ app/controllers/application_controller.rb
187
+ app/controllers/static_pages_controller.rb
188
+ app/views/layouts/application.html.erb
189
+ app/views/static_pages/....html.erb
190
+ app/views/static_pages/about.html.erb
191
+ app/views/static_pages/help.html.erb
192
+ bin/spring
193
+ config/secrets.yml
194
+ db/schema.rb
195
+ layout_file
196
+ public/assets/.sprockets-manifest-c51a6318a50b80e2a66009ec0b9c9e8a.json
197
+ public/assets/application-7441e90aaeea08ce2c76b4123cab0e756e62755c6fc9732dae8cff9bdd6bdd5d.js
198
+ public/assets/application-7441e90aaeea08ce2c76b4123cab0e756e62755c6fc9732dae8cff9bdd6bdd5d.js.gz
199
+ public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css
200
+ public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css.gz
201
+ test/controllers/static_pages_controller_test.rb
177
202
  ```

2

追記

2020/01/15 08:51

投稿

babi-0105
babi-0105

スコア10

title CHANGED
File without changes
body CHANGED
@@ -111,6 +111,8 @@
111
111
  #追記
112
112
  (1)テストcode
113
113
  →rails test:(該当のソースコードの欄に記載)
114
+
115
+ ⇩controllers/static_pages_controller_test.rb
114
116
  ```StaticPagesControllerTest
115
117
  require 'test_helper'
116
118
 
@@ -142,6 +144,7 @@
142
144
  end
143
145
  ```
144
146
 
147
+ ⇩integration/site_layout_test.rb
145
148
  ```sitelayouttest
146
149
  require 'test_helper'
147
150
 

1

修正しました。

2020/01/15 06:08

投稿

babi-0105
babi-0105

スコア10

title CHANGED
File without changes
body CHANGED
@@ -106,4 +106,69 @@
106
106
 
107
107
  情報が至らぬ可能性があります。
108
108
  追記すべき情報などございましたら、言っていただきたいです。
109
- 回答お待ちしております。
109
+ 回答お待ちしております。
110
+
111
+ #追記
112
+ (1)テストcode
113
+ →rails test:(該当のソースコードの欄に記載)
114
+ ```StaticPagesControllerTest
115
+ require 'test_helper'
116
+
117
+ class StaticPagesControllerTest < ActionDispatch::IntegrationTest
118
+
119
+ test "should get home" do
120
+ get root_path
121
+ assert_response :success
122
+ assert_select "title", "Home | Ruby on Rails Tutorial Sample App"
123
+ end
124
+
125
+ test "should get help" do
126
+ get help_path
127
+ assert_response :success
128
+ assert_select "title", "Help | Ruby on Rails Tutorial Sample App"
129
+ end
130
+
131
+ test "should get about" do
132
+ get about_path
133
+ assert_response :success
134
+ assert_select "title", "About | Ruby on Rails Tutorial Sample App"
135
+ end
136
+
137
+ test "should get contact" do
138
+ get contact_path
139
+ assert_response :success
140
+ assert_select "title", "Contact | Ruby on Rails Tutorial Sample App"
141
+ end
142
+ end
143
+ ```
144
+
145
+ ```sitelayouttest
146
+ require 'test_helper'
147
+
148
+ class SiteLayoutTest < ActionDispatch::IntegrationTest
149
+
150
+ test "layout links" do
151
+ get root_path
152
+ assert_template 'static_pages/home'
153
+ assert_select "a[href=?]", root_path, count: 2
154
+ assert_select "a[href=?]", help_path
155
+ assert_select "a[href=?]", about_path
156
+ assert_select "a[href=?]", contact_path
157
+ get contact_path
158
+ assert_select "title", full_title("Contact")
159
+ get signup_path
160
+ assert_select "title", full_title("Sign up")
161
+ end
162
+ end
163
+ ```
164
+
165
+ (2)git status の結果
166
+ filling-in-layoutブランチも、masterブランチも結果は同じでした。
167
+ ```
168
+ ec2-user:~/environment/sample_app (master) $ git status
169
+
170
+ On branch master
171
+ Your branch is up-to-date with 'origin/master'.
172
+
173
+ nothing to commit, working tree clean
174
+ ```