Sha256: f5e31d48a352709cf999b27d6f62e61a1995051c573fa9546e81b89adcfe74ad

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

Contents

# frozen_string_literal: true

require "spec_helper"

describe "Edit a page", type: :feature do
  include_context "feature admin"
  let(:feature) { create(:feature, manifest_name: "pages", participatory_process: participatory_process) }
  let(:manifest_name) { "pages" }

  describe "admin page" do
    before do
      create(:page, feature: feature, body: body)
      visit_feature_admin
    end

    let(:body) do
      {
        "en" => "<p>Content</p>",
        "ca" => "<p>Contingut</p>",
        "es" => "<p>Contenido</p>"
      }
    end

    it "updates the page" do
      new_body = {
        en: "<p>New body</p>",
        ca: "<p>Nou cos</p>",
        es: "<p>Nuevo cuerpo</p>"
      }

      within "form.edit_page" do
        fill_in_i18n_editor(:page_body, "#body-tabs", new_body)
        find("*[type=submit]").click
      end

      within ".callout-wrapper" do
        expect(page).to have_content("successfully")
      end

      visit_feature

      expect(page).to have_content("New body")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
decidim-0.2.0 decidim-pages/spec/features/admin_spec.rb