docbrown/spec/system/comments/user_delete_a_comment_spec.rb
Lisa Sy 36e271e1cb
Deprecate old button stylings with Crayons buttons (#10694) [deploy]
* Deprecate old buttons.scss file

* Replace outdated button styles with Crayons button styling

* Update additional views after removing old button styling

* Update tests

* Update test

* Update test

* Fix button placements
2020-10-14 07:28:41 -07:00

24 lines
604 B
Ruby

require "rails_helper"
RSpec.describe "Deleting Comment", type: :system, js: true, elasticsearch: "FeedContent" do
let(:user) { create(:user) }
let(:raw_comment) { Faker::Lorem.paragraph }
let(:article) do
create(:article, user_id: user.id, show_comments: true)
end
let(:comment) { create(:comment, commentable: article, commentable_type: "Article", user: user) }
before do
sign_in user
end
it "works" do
visit "/"
visit "#{comment.path}/delete_confirm"
wait_for_javascript
click_button("Delete")
expect(page).to have_current_path(article.path)
end
end