* Create .travis.yml * Update .travis.yml * Add postgresql to travis * Change travis's postgresql version * Add chrome addon to travis * Adjust travis config --skip-ci * Change travis dist * Change travis to use Chrome --skip-ci * Use IntegraitonHelpers --skip-ci * Add no-sandbox option to headless chrome * Add sudo to travis * Fix broken spec * Update travis.yml * Change how travis store bundler cache * Update chromedriver command * Add CodeClimate to travis --skip-ci * Remove deadcode --skip-ci * Remove dead code * Change rspec-retry back to 3 * Add deploy script to travis * Safelist only master for Travis --skip-ci
24 lines
552 B
Ruby
24 lines
552 B
Ruby
require "rails_helper"
|
|
|
|
RSpec.feature "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
|
|
article
|
|
end
|
|
|
|
scenario "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
|