Sha256: 90a9d1244034809e557aef9baec7fa7176709e1a5c35d7b4aa9269fb8fafe417

Contents?: true

Size: 883 Bytes

Versions: 2

Compression:

Stored size: 883 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

RSpec.feature 'Admin Posts', type: :system do
  before { sign_in }

  describe 'listing posts' do
    let!(:posts) { create_list(:spina_blog_post, 3, published_at: Date.today + 1) }

    it 'shows all the posts' do
      visit '/admin/conferences/blog/posts'
      expect(page).to have_content "Blog Post"
    end
  end

  describe 'creating a post' do
    it 'creates a post', js: true do
      visit '/admin/conferences/blog/posts'
      find(:css, 'a[href="/admin/conferences/blog/posts/new"]').click
      fill_in 'Title', with: 'Title of Blog post'
      find(
        :css, 'trix-editor[input*="content_input"]'
      ).set('Foobar')
      click_on 'Save post'
      within 'nav[data-controller="navigation"]' do
        click_on 'Posts'
      end
      expect(page).to have_content 'Title of Blog post'
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spina-admin-conferences-blog-0.3.1 spec/system/spina/admin/conferences/blog/posts_spec.rb
spina-admin-conferences-blog-0.2.0 spec/system/spina/admin/conferences/blog/posts_spec.rb