Sha256: 68c5cfabb376a711b4266844941028a503816ba7b5b4203c0da85f34ecc8f94e

Contents?: true

Size: 1.12 KB

Versions: 29

Compression:

Stored size: 1.12 KB

Contents

require 'rails_helper'
feature "Richtext editing", js: true do
  background do
    auth_as_user
  end

  scenario "Image toolbar available when controller support attachments" do
    visit new_admin_node_path(content_type: 'TextPage')
    wait_for_all_richtexts
    fill_in_richtext 'Text', with: "some text"
    expect(page).to have_css("a.cke_button__image")
  end

  scenario "Image toolbar unavailable when controller doesn't support attachments" do
    allow_any_instance_of(Admin::BooksController).to receive(:releaf_richtext_attachment_upload_url).and_return("")
    visit new_admin_book_path
    wait_for_all_richtexts
    fill_in_richtext "Summary", with: "some text"
    expect(page).to_not have_css("a.cke_button__image")
  end

  scenario "Test helper fills in correct value" do
    visit new_admin_node_path(content_type: 'TextPage')
    html = %Q[ <p class="xxx" id='yyy'> &quot;HTML&quot; 'content' </p> ]
    wait_for_all_richtexts
    fill_in_richtext 'Text', with: html
    content = evaluate_script('CKEDITOR.instances["resource_content_attributes_text_html"].getData();')
    expect(content).to match_html html
  end

end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
releaf-core-1.1.22 spec/features/richtext_spec.rb
releaf-core-1.1.21 spec/features/richtext_spec.rb
releaf-core-1.1.20 spec/features/richtext_spec.rb
releaf-core-1.1.19 spec/features/richtext_spec.rb
releaf-core-1.1.18 spec/features/richtext_spec.rb
releaf-core-1.1.17 spec/features/richtext_spec.rb
releaf-core-1.1.16 spec/features/richtext_spec.rb
releaf-core-1.1.15 spec/features/richtext_spec.rb
releaf-core-1.1.14 spec/features/richtext_spec.rb
releaf-core-1.1.13 spec/features/richtext_spec.rb
releaf-core-1.1.12 spec/features/richtext_spec.rb
releaf-core-1.1.11 spec/features/richtext_spec.rb
releaf-core-1.1.10 spec/features/richtext_spec.rb
releaf-core-1.1.9 spec/features/richtext_spec.rb
releaf-core-1.1.8 spec/features/richtext_spec.rb
releaf-core-1.1.7 spec/features/richtext_spec.rb
releaf-core-1.1.6 spec/features/richtext_spec.rb
releaf-core-1.1.5 spec/features/richtext_spec.rb
releaf-core-1.1.4 spec/features/richtext_spec.rb
releaf-core-1.1.3 spec/features/richtext_spec.rb