diff --git a/app/views/note_versions/index.html.erb b/app/views/note_versions/index.html.erb index 841f9f9ca..70e36390d 100644 --- a/app/views/note_versions/index.html.erb +++ b/app/views/note_versions/index.html.erb @@ -20,7 +20,7 @@ <%= link_to note_version.post_id, post_path(note_version.post_id) %> - <%= link_to "#{note_version.note_id}", note_versions_path(:search => {:note_id => note_version.note_id}) %> + <%= link_to "#{note_version.note_id}.#{note_version.id}", note_versions_path(:search => {:note_id => note_version.note_id}) %> <%= h(note_version.body) %> <% unless note_version.is_active? %>(deleted)<% end %> <% if CurrentUser.is_janitor? %> diff --git a/test/unit/note_test.rb b/test/unit/note_test.rb index 4cec97135..fee01a7f2 100644 --- a/test/unit/note_test.rb +++ b/test/unit/note_test.rb @@ -14,6 +14,24 @@ class NoteTest < ActiveSupport::TestCase CurrentUser.ip_addr = nil end + context "for a post that already has a note" do + setup do + @post = FactoryGirl.create(:post) + @note = FactoryGirl.create(:note, :post => @post) + end + + context "when the note is deleted the post" do + setup do + @note.toggle!(:is_active) + end + + should "null out its last_noted_at_field" do + @post.reload + assert_nil(@post.last_noted_at) + end + end + end + context "creating a note" do setup do @post = FactoryGirl.create(:post)