docbrown/spec/system/articles/user_creates_an_article_spec.rb
rhymes 941ab4178b Articles API: create and update (#2844)
* Add system test to create article from the editor

* Move article creation from API to app controller

* Fix system test to edit posts

* Move article update from API to app controller

* Rewrite create article API using API key

* Add main_image and canonical_url to allowed creation params

* Rewrite update article API using API key

* Fix tests and have Comments API inherit from API
2019-05-16 12:26:24 -04:00

17 lines
464 B
Ruby

require "rails_helper"
RSpec.describe "Creating an article with the editor", type: :system do
let(:user) { create(:user) }
let!(:template) { file_fixture("article_published.txt").read }
before do
sign_in user
end
it "creates a new article", js: true, retry: 3 do
visit new_path
fill_in "article_body_markdown", with: template
click_button "SAVE CHANGES"
expect(page).to have_selector("header h1", text: "Sample Article")
end
end