Sha256: 892270ad4f65a4c0bc1668df14102347b2cc32e61fd2b0d7443cebf16ef102fc

Contents?: true

Size: 1.57 KB

Versions: 9

Compression:

Stored size: 1.57 KB

Contents

require 'test_helper'

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

      def test_allows_commenting
        user = create_user(email: 'bcrouse-test@workarea.com')
        visit admin.user_path(user)

        click_link 'Comments'

        fill_in 'comment[body]', with: 'test comment'
        click_button 'create_comment'

        assert(page.has_content?('Success'))
      end

      def test_notifying_admins
        me = create_user(email: 'foo@workarea.com')

        create_user(
          first_name: 'Bar',
          last_name: 'Baby',
          email: 'bar@workarea.com'
        )

        create_user(
          first_name: 'Baz',
          last_name: 'Bat',
          email: 'baz@workarea.com',
          admin: true
        )

        visit admin.user_path(me)

        click_link 'Comments'

        find_field('comment[body]').send_keys(['@'])

        refute(page.has_content?('Bar Baby'))
        assert(page.has_content?('Baz Bat'))

        find('.tribute-container li', text: 'Baz Bat (baz@workarea.com)').click
        click_button 'create_comment'

        assert(page.has_content?('Success'))
      end

      def test_subscribing_to_comments
        user = create_user(email: 'bcrouse-test@workarea.com')
        visit admin.user_path(user)

        click_link 'Comments'
        click_link t('workarea.admin.comments.index.subscribe')
        assert(page.has_content?('Success'))

        click_link t('workarea.admin.comments.index.unsubscribe')
        assert(page.has_content?('Success'))
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
workarea-admin-3.5.19 test/system/workarea/admin/comments_system_test.rb
workarea-admin-3.5.18 test/system/workarea/admin/comments_system_test.rb
workarea-admin-3.5.17 test/system/workarea/admin/comments_system_test.rb
workarea-admin-3.5.16 test/system/workarea/admin/comments_system_test.rb
workarea-admin-3.5.15 test/system/workarea/admin/comments_system_test.rb
workarea-admin-3.5.14 test/system/workarea/admin/comments_system_test.rb
workarea-admin-3.5.13 test/system/workarea/admin/comments_system_test.rb
workarea-admin-3.5.12 test/system/workarea/admin/comments_system_test.rb
workarea-admin-3.5.11 test/system/workarea/admin/comments_system_test.rb