Sha256: 5b8078de2eb8bc21b377d59a851c29278c204db7ac637b94ff1ab53925575cbd

Contents?: true

Size: 1.22 KB

Versions: 62

Compression:

Stored size: 1.22 KB

Contents

require 'test_helper'

module Workarea
  module Admin
    class PagesIntegrationTest < Workarea::IntegrationTest
      include Admin::IntegrationTest

      def test_updates_a_page
        page = create_page

        patch admin.content_page_path(page),
          params: {
            page: {
              name: 'Test Page',
              slug: 'test-slug',
              tag_list: 'different,tags',
              show_navigation: true
            }
          }

        page.reload
        assert_equal('Test Page', page.name)
        assert_equal('test-slug', page.slug)
        assert_equal(%w(different tags), page.tags)
        assert(page.show_navigation?)
      end

      def test_deletes_a_page
        page = create_page
        delete admin.content_page_path(page)
        assert(Content::Page.empty?)
      end

      def test_autocompletes_partial_queries_when_xhr
        page = create_page(name: 'Test')
        get admin.content_pages_path(format: 'json', q: 'tes'), xhr: true

        results = JSON.parse(response.body)
        assert_equal(1, results['results'].length)
        assert(results['results'].first['label'].present?)
        assert_equal(page.id.to_s, results['results'].first['value'])
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-admin-3.5.27 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.5.26 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.4.45 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.5.25 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.5.23 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.4.44 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.5.22 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.4.43 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.5.21 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.4.42 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.5.20 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.4.41 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.5.19 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.4.40 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.5.18 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.4.39 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.5.17 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.4.38 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.5.16 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.4.37 test/integration/workarea/admin/pages_integration_test.rb