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.4.27 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.5.4 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.4.26 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.5.3 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.4.25 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.5.2 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.4.24 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.5.1 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.4.23 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.4.22 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.5.0 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.4.21 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.5.0.beta.1 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.4.20 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.4.19 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.4.18 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.4.17 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.4.16 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.4.15 test/integration/workarea/admin/pages_integration_test.rb
workarea-admin-3.4.14 test/integration/workarea/admin/pages_integration_test.rb