-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
21f394f
commit 18548b3
Showing
9 changed files
with
101 additions
and
13 deletions.
There are no files selected for viewing
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
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
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
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html | ||
movie1: | ||
title: mp4動画 | ||
description: mp4の動画です | ||
user: kimura | ||
|
||
one: | ||
title: MyString | ||
description: MyText | ||
tags: MyString | ||
public_scope: 1 | ||
|
||
two: | ||
title: MyString | ||
description: MyText | ||
tags: MyString | ||
public_scope: 1 | ||
movie2: | ||
title: mov動画 | ||
description: movの動画です | ||
user: kimura |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'application_system_test_case' | ||
|
||
class MoviesTest < ApplicationSystemTestCase | ||
|
||
test 'GET /movies' do | ||
visit_with_auth '/movies', 'kimura' | ||
assert_equal '動画 | FBC', title | ||
end | ||
|
||
test 'show movie' do | ||
visit_with_auth "/movies/#{movies(:movie1).id}", 'kimura' | ||
assert_equal '動画: mp4動画 | FBC', title | ||
end | ||
|
||
test 'page has a comment form ' do | ||
visit_with_auth "/movies/#{movies(:movie1).id}", 'kimura' | ||
assert_selector '.thread-comment-form' | ||
end | ||
|
||
test 'add new mp4 movie' do | ||
visit_with_auth new_movie_path, 'kimura' | ||
assert_equal new_movie_path, current_path | ||
fill_in 'movie[title]', with: '新規動画を作成する' | ||
fill_in 'movie[description]', with: '新規動画を作成する本文です' | ||
attach_file 'movie[movie_data]', 'test/fixtures/files/movies/sample.mp4' | ||
click_button '動画を追加する' | ||
assert_text '動画を追加しました' | ||
end | ||
|
||
test 'add new mov movie' do | ||
visit_with_auth new_movie_path, 'kimura' | ||
assert_equal new_movie_path, current_path | ||
fill_in 'movie[title]', with: '新規動画を作成する' | ||
fill_in 'movie[description]', with: '新規動画を作成する本文です' | ||
attach_file 'movie[movie_data]', 'test/fixtures/files/movies/sample.mov' | ||
click_button '動画を追加する' | ||
assert_text '動画を追加しました' | ||
end | ||
|
||
test 'doc can relate practice' do | ||
visit_with_auth new_movie_path, 'kimura' | ||
fill_in 'movie[title]', with: '動画に関連プラクティスを指定' | ||
fill_in 'movie[description]', with: '動画に関連プラクティスを指定' | ||
first('.choices__inner').click | ||
find('.choices__item--choice', text: '[UNIX] Linuxのファイル操作の基礎を覚える').click | ||
attach_file 'movie[movie_data]', 'test/fixtures/files/movies/sample.mp4' | ||
click_button '動画を追加する' | ||
assert_text 'Linuxのファイル操作の基礎を覚える' | ||
end | ||
|
||
test 'show comment count' do | ||
visit_with_auth "/movies/#{movies(:movie1).id}", 'kimura' | ||
assert_selector '#comment_count', text: 0 | ||
|
||
fill_in 'new_comment[description]', with: 'コメント数表示のテストです。' | ||
click_button 'コメントする' | ||
|
||
visit current_path | ||
assert_selector '#comment_count', text: 1 | ||
end | ||
end |