docbrown/spec/system/comments/user_delete_a_comment_spec.rb
Mac Siri fc39f24ee3 Migrate feature test to system test (#2301)
* Move all features to system

* Remove database_cleaner & apply use_transactional_fixtures

* Move rspec-retry to :test

* Update Capybara config

* Update rails_helper

* Fix user_visits_a_comments_page_spec.rb

* Fix lint
2019-04-04 12:15:10 -04:00

21 lines
546 B
Ruby

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