Add show actions for note, artist, artist commentary versions.

Add these endpoints:

* /note_versions/1234
* /artist_versions/1234
* /artist_commentary_versions/1234

This is so the /ip_addresses listing can link to these endpoints.
This commit is contained in:
evazion
2019-11-11 12:52:50 -06:00
parent 9cf5b1f01c
commit 2aac42b112
7 changed files with 65 additions and 30 deletions

View File

@@ -2,14 +2,11 @@ require 'test_helper'
class ArtistCommentaryVersionsControllerTest < ActionDispatch::IntegrationTest
context "The artist commentary versions controller" do
setup do
@user = FactoryBot.create(:user)
as_user do
@commentary1 = FactoryBot.create(:artist_commentary)
@commentary2 = FactoryBot.create(:artist_commentary)
end
end
setup do
@user = create(:user)
@commentary1 = as(@user) { create(:artist_commentary) }
@commentary2 = as(@user) { create(:artist_commentary) }
end
context "index action" do
should "render" do
@@ -17,5 +14,15 @@ class ArtistCommentaryVersionsControllerTest < ActionDispatch::IntegrationTest
assert_response :success
end
end
context "show action" do
should "work" do
get artist_commentary_version_path(@commentary1.versions.first)
assert_redirected_to artist_commentary_versions_path(search: { post_id: @commentary1.post_id })
get artist_commentary_version_path(@commentary1.versions.first), as: :json
assert_response :success
end
end
end
end