spec/app/models/commontator/comment_spec.rb in commontator-1.1.3 vs spec/app/models/commontator/comment_spec.rb in commontator-2.0.0
- old
+ new
@@ -20,41 +20,42 @@
it 'must know if it has been modified' do
@comment.save!
@comment.is_modified?.must_equal false
- sleep 1
@comment.body = 'Something else'
+ @comment.editor = @user
@comment.save!
@comment.is_modified?.must_equal true
end
it 'must know if it has been deleted' do
user = DummyUser.new
@comment.is_deleted?.must_equal false
- @comment.deleter.must_be_nil
+ @comment.editor.must_be_nil
- @comment.delete(user)
+ @comment.delete_by(user)
@comment.is_deleted?.must_equal true
- @comment.deleter.must_equal user
+ @comment.editor.must_equal user
- @comment.undelete
+ @comment.undelete_by(user)
@comment.is_deleted?.must_equal false
end
it 'must make proper timestamps' do
@comment.save!
@comment.timestamp.must_equal "#{@thread.config.comment_create_verb_past.capitalize} on #{@comment.created_at.strftime(@thread.config.timestamp_format)}"
- sleep 1
@comment.body = 'Something else'
+ @comment.editor = @user
@comment.save!
- @comment.timestamp.must_equal "Last modified on #{@comment.updated_at.strftime(@thread.config.timestamp_format)}"
+ @comment.timestamp.must_equal "#{@thread.config.comment_create_verb_past.capitalize} on #{@comment.created_at.strftime(@thread.config.timestamp_format)}" + \
+ " | Last #{@thread.config.comment_edit_verb_past} on #{@comment.updated_at.strftime(@thread.config.timestamp_format)}"
end
end
end