Sha256: 549eec2abd257ba1e9c0f47c867c2f22164be7648fff327ccc4d1691bf31d019

Contents?: true

Size: 859 Bytes

Versions: 5

Compression:

Stored size: 859 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_css 'tbody tr', count: 3
    end
  end

  describe 'creating a post' do
    it 'creates a post', js: true do
      visit '/admin/conferences/blog/posts'
      click_on 'New Post'
      fill_in 'Post title', with: 'Title of Blog post'
      find(
        :css, 'trix-editor[input*="content_input"]'
      ).set('Foobar')
      click_on 'Save post'
      within '#header' do
        click_on 'Posts'
      end
      within 'tbody' do
        expect(page).to have_content 'Title of Blog post'
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spina-admin-conferences-blog-0.1.4 spec/system/spina/admin/conferences/blog/posts_spec.rb
spina-admin-conferences-blog-0.1.3 spec/system/spina/admin/conferences/blog/posts_spec.rb
spina-admin-conferences-blog-0.1.2 spec/system/spina/admin/conferences/blog/posts_spec.rb
spina-admin-conferences-blog-0.1.1 spec/system/spina/admin/conferences/blog/posts_spec.rb
spina-admin-conferences-blog-0.1.0 spec/system/spina/admin/conferences/blog/posts_spec.rb