docbrown/spec/features/user_delete_a_comment_spec.rb
Ben Halpern e4c120db5d
Replace dev.to with APP_DOMAIN config in a few places (#1406)
* Replace dev.to with APP_DOMAIN config in a few places

* Modify some tests
2018-12-26 18:13:05 -05:00

21 lines
557 B
Ruby

require "rails_helper"
RSpec.describe "Deleting Comment", type: :feature, js: true 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", retry: 3 do
visit "/"
visit comment.path + "/delete_confirm"
click_link("DELETE")
expect(page).to have_current_path(article.path)
end
end