docbrown/spec/features/user_deletes_an_article_spec.rb
Andy Zhao a1010201f2 Notifications part 2 (#1156)
* Remove stream and add new notification views

* Actually remove Stream

* Move followers query to async method

* Remove unused tests and fix query

* Try using without delay instead

* Add without delay and escape HTML

* Make all tests pending for now
2018-11-19 18:14:24 -05:00

24 lines
629 B
Ruby

require "rails_helper"
RSpec.describe "Deleting Article", js: true do
let(:author) { create(:user) }
let(:article) { create(:article, user_id: author.id) }
def delete_article_via_dashboard
visit "/dashboard"
delete_link = find_link("DELETE")
delete_link.click
second_link = find_link("DELETE")
second_link.click
end
before do
Notification.send_to_followers(article, "Published")
end
it "author of article deletes own article" do
sign_in author
delete_article_via_dashboard
expect(page).to have_text("Write your first post now")
end
end