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

@@ -4,24 +4,14 @@ class NoteVersionsControllerTest < ActionDispatch::IntegrationTest
context "The note versions controller" do
setup do
@user = create(:user)
@user_2 = create(:user)
as(@user) { @note = create(:note) }
as(@user_2) { @note.update(body: "1 2") }
as(@user) { @note.update(body: "1 2 3") }
end
context "index action" do
setup do
as_user do
@note = create(:note)
end
@user_2 = create(:user)
CurrentUser.scoped(@user_2, "1.2.3.4") do
@note.update(body: "1 2")
end
CurrentUser.scoped(@user, "1.2.3.4") do
@note.update(body: "1 2 3")
end
end
should "list all versions" do
get note_versions_path
assert_response :success
@@ -32,5 +22,15 @@ class NoteVersionsControllerTest < ActionDispatch::IntegrationTest
assert_response :success
end
end
context "show action" do
should "work" do
get note_version_path(@note.versions.first)
assert_redirected_to note_versions_path(search: { note_id: @note.id })
get note_version_path(@note.versions.first), as: :json
assert_response :success
end
end
end
end