docbrown/spec/system/articles/user_deletes_an_article_spec.rb
Ben Halpern 158f56bc9d
Add page for users to "manage" their posts after publication (distribution, etc.) (#2627)
* Set up basic /manage route

* Add basic article manage page

* Add tips and finalize permissions for /manage

* Add final test and add manage button to article show

* Update failing specs
2019-05-01 09:00:09 -04:00

14 lines
379 B
Ruby

require "rails_helper"
RSpec.describe "Deleting Article", type: :system do
let(:article) { create(:article) }
it "author of article deletes own article" do
sign_in article.user
visit "/dashboard"
click_on "MANAGE"
click_on "DELETE"
click_on "DELETE" # This is for confirming deletion
expect(page).to have_text("Write your first post now")
end
end