* 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
17 lines
464 B
Ruby
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
|