質問編集履歴

3

追記

2020/01/15 08:51

投稿

babi-0105
babi-0105

スコア10

test CHANGED
File without changes
test CHANGED
@@ -351,3 +351,53 @@
351
351
  nothing to commit, working tree clean
352
352
 
353
353
  ```
354
+
355
+
356
+
357
+ (3) masterブランチと filling-in-layoutブランチの差分のファイル名の確認
358
+
359
+ ```
360
+
361
+ $ git diff --name-only master filling-in-layout
362
+
363
+
364
+
365
+ Gemfile.lock
366
+
367
+ Guardfile
368
+
369
+ app/assets/stylesheets/static_pages.scss
370
+
371
+ app/controllers/application_controller.rb
372
+
373
+ app/controllers/static_pages_controller.rb
374
+
375
+ app/views/layouts/application.html.erb
376
+
377
+ app/views/static_pages/....html.erb
378
+
379
+ app/views/static_pages/about.html.erb
380
+
381
+ app/views/static_pages/help.html.erb
382
+
383
+ bin/spring
384
+
385
+ config/secrets.yml
386
+
387
+ db/schema.rb
388
+
389
+ layout_file
390
+
391
+ public/assets/.sprockets-manifest-c51a6318a50b80e2a66009ec0b9c9e8a.json
392
+
393
+ public/assets/application-7441e90aaeea08ce2c76b4123cab0e756e62755c6fc9732dae8cff9bdd6bdd5d.js
394
+
395
+ public/assets/application-7441e90aaeea08ce2c76b4123cab0e756e62755c6fc9732dae8cff9bdd6bdd5d.js.gz
396
+
397
+ public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css
398
+
399
+ public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css.gz
400
+
401
+ test/controllers/static_pages_controller_test.rb
402
+
403
+ ```

2

追記

2020/01/15 08:51

投稿

babi-0105
babi-0105

スコア10

test CHANGED
File without changes
test CHANGED
@@ -224,6 +224,10 @@
224
224
 
225
225
  →rails test:(該当のソースコードの欄に記載)
226
226
 
227
+
228
+
229
+ ⇩controllers/static_pages_controller_test.rb
230
+
227
231
  ```StaticPagesControllerTest
228
232
 
229
233
  require 'test_helper'
@@ -286,6 +290,8 @@
286
290
 
287
291
 
288
292
 
293
+ ⇩integration/site_layout_test.rb
294
+
289
295
  ```sitelayouttest
290
296
 
291
297
  require 'test_helper'

1

修正しました。

2020/01/15 06:08

投稿

babi-0105
babi-0105

スコア10

test CHANGED
File without changes
test CHANGED
@@ -215,3 +215,133 @@
215
215
  追記すべき情報などございましたら、言っていただきたいです。
216
216
 
217
217
  回答お待ちしております。
218
+
219
+
220
+
221
+ #追記
222
+
223
+ (1)テストcode
224
+
225
+ →rails test:(該当のソースコードの欄に記載)
226
+
227
+ ```StaticPagesControllerTest
228
+
229
+ require 'test_helper'
230
+
231
+
232
+
233
+ class StaticPagesControllerTest < ActionDispatch::IntegrationTest
234
+
235
+
236
+
237
+ test "should get home" do
238
+
239
+ get root_path
240
+
241
+ assert_response :success
242
+
243
+ assert_select "title", "Home | Ruby on Rails Tutorial Sample App"
244
+
245
+ end
246
+
247
+
248
+
249
+ test "should get help" do
250
+
251
+ get help_path
252
+
253
+ assert_response :success
254
+
255
+ assert_select "title", "Help | Ruby on Rails Tutorial Sample App"
256
+
257
+ end
258
+
259
+
260
+
261
+ test "should get about" do
262
+
263
+ get about_path
264
+
265
+ assert_response :success
266
+
267
+ assert_select "title", "About | Ruby on Rails Tutorial Sample App"
268
+
269
+ end
270
+
271
+
272
+
273
+ test "should get contact" do
274
+
275
+ get contact_path
276
+
277
+ assert_response :success
278
+
279
+ assert_select "title", "Contact | Ruby on Rails Tutorial Sample App"
280
+
281
+ end
282
+
283
+ end
284
+
285
+ ```
286
+
287
+
288
+
289
+ ```sitelayouttest
290
+
291
+ require 'test_helper'
292
+
293
+
294
+
295
+ class SiteLayoutTest < ActionDispatch::IntegrationTest
296
+
297
+
298
+
299
+ test "layout links" do
300
+
301
+ get root_path
302
+
303
+ assert_template 'static_pages/home'
304
+
305
+ assert_select "a[href=?]", root_path, count: 2
306
+
307
+ assert_select "a[href=?]", help_path
308
+
309
+ assert_select "a[href=?]", about_path
310
+
311
+ assert_select "a[href=?]", contact_path
312
+
313
+ get contact_path
314
+
315
+ assert_select "title", full_title("Contact")
316
+
317
+ get signup_path
318
+
319
+ assert_select "title", full_title("Sign up")
320
+
321
+ end
322
+
323
+ end
324
+
325
+ ```
326
+
327
+
328
+
329
+ (2)git status の結果
330
+
331
+ filling-in-layoutブランチも、masterブランチも結果は同じでした。
332
+
333
+ ```
334
+
335
+ ec2-user:~/environment/sample_app (master) $ git status
336
+
337
+
338
+
339
+ On branch master
340
+
341
+ Your branch is up-to-date with 'origin/master'.
342
+
343
+
344
+
345
+ nothing to commit, working tree clean
346
+
347
+ ```