Sha256: 9e7717bedda9902c812b85a892267356eb6507abe48ea2cdb0c5e6401e0ca7a0

Contents?: true

Size: 1.23 KB

Versions: 62

Compression:

Stored size: 1.23 KB

Contents

require 'test_helper'

module Workarea
  module Admin
    class RedirectsSystemTest < SystemTest
      include Admin::IntegrationTest

      def test_managing_redirects
        visit admin.navigation_redirects_path

        click_button t('workarea.admin.navigation_redirects.index.add_new')
        fill_in 'redirect[path]', with: '/test'
        fill_in 'redirect[destination]', with: 'http://www.google.com'
        click_button 'save_redirect'

        assert(page.has_content?('/test'))

        click_link t('workarea.admin.actions.delete')
        assert(page.has_no_content?('/test'))
      end

      def test_filtering_redirects
        create_redirect(path: "/original-foo", destination: '/new-bar')
        create_redirect(path: "/foo", destination: '/new-baz')

        visit admin.navigation_redirects_path

        fill_in 'search_redirects', with: 'foo'
        find('#search_redirects').native.send_keys(:return)

        assert(page.has_content?('/foo'))
        assert(page.has_no_content?('/original-foo'))

        fill_in 'search_redirects', with: 'new'
        find('#search_redirects').native.send_keys(:return)

        assert(page.has_content?('/foo'))
        assert(page.has_content?('/original-foo'))
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

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