docbrown/spec/requests/comments_update_spec.rb
Andy Zhao 2db2dd1e5a WIP Refactor/notifications (#1131)
* Add new columns to notifications table

* Remove stream from notifications and add new methods

* Turn off moderation comment notifications

* Add notifiable_type index to migration

* Stop creation of Stream-based notification model instances

* Add notification model create hooks

* Add badge achievement notification creation hook

* Fix some specs

* Add missing @ symbol

* Fix for tests and rename a few things

* forgot to uncomment code sigh
2018-11-19 16:09:02 -05:00

20 lines
597 B
Ruby

require "rails_helper"
RSpec.describe "CommentsUpdate", type: :request do
let(:user) { create(:user) }
let(:article) { create(:article, user_id: user.id) }
let(:comment) { create(:comment, user_id: user.id, commentable_id: article.id) }
before do
sign_in user
Notification.send_new_comment_notifications(comment)
end
it "updates ordinary article with proper params" do
new_body = "NEW TITLE #{rand(100)}"
put "/comments/#{comment.id}", params: {
comment: { body_markdown: new_body }
}
expect(Comment.last.processed_html).to include(new_body)
end
end