here come the tags
This commit is contained in:
parent
c8732b6332
commit
29368bfdb9
16 changed files with 155 additions and 2 deletions
48
test/controllers/tag_to_clips_controller_test.rb
Normal file
48
test/controllers/tag_to_clips_controller_test.rb
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
require "test_helper"
|
||||
|
||||
class TagToClipsControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
@tag_to_clip = tag_to_clips(:one)
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
get tag_to_clips_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get new_tag_to_clip_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create tag_to_clip" do
|
||||
assert_difference("TagToClip.count") do
|
||||
post tag_to_clips_url, params: { tag_to_clip: { clip_id: @tag_to_clip.clip_id, tag_id: @tag_to_clip.tag_id } }
|
||||
end
|
||||
|
||||
assert_redirected_to tag_to_clip_url(TagToClip.last)
|
||||
end
|
||||
|
||||
test "should show tag_to_clip" do
|
||||
get tag_to_clip_url(@tag_to_clip)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get edit_tag_to_clip_url(@tag_to_clip)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update tag_to_clip" do
|
||||
patch tag_to_clip_url(@tag_to_clip), params: { tag_to_clip: { clip_id: @tag_to_clip.clip_id, tag_id: @tag_to_clip.tag_id } }
|
||||
assert_redirected_to tag_to_clip_url(@tag_to_clip)
|
||||
end
|
||||
|
||||
test "should destroy tag_to_clip" do
|
||||
assert_difference("TagToClip.count", -1) do
|
||||
delete tag_to_clip_url(@tag_to_clip)
|
||||
end
|
||||
|
||||
assert_redirected_to tag_to_clips_url
|
||||
end
|
||||
end
|
||||
9
test/fixtures/tag_to_clips.yml
vendored
Normal file
9
test/fixtures/tag_to_clips.yml
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
clip: one
|
||||
tag: one
|
||||
|
||||
two:
|
||||
clip: two
|
||||
tag: two
|
||||
7
test/fixtures/tags.yml
vendored
Normal file
7
test/fixtures/tags.yml
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
name: MyString
|
||||
|
||||
two:
|
||||
name: MyString
|
||||
7
test/models/tag_test.rb
Normal file
7
test/models/tag_test.rb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
require "test_helper"
|
||||
|
||||
class TagTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
7
test/models/tag_to_clip_test.rb
Normal file
7
test/models/tag_to_clip_test.rb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
require "test_helper"
|
||||
|
||||
class TagToClipTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue