Sha256: a6076646c520ebf149b0f7eb3e93f96a06f18af848fb0259152ac9d1c9672f8b

Contents?: true

Size: 1.58 KB

Versions: 12

Compression:

Stored size: 1.58 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_button t('workarea.admin.comments.index.subscribe')
        assert(page.has_content?('Success'))

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
workarea-admin-3.5.10 test/system/workarea/admin/comments_system_test.rb
workarea-admin-3.5.9 test/system/workarea/admin/comments_system_test.rb
workarea-admin-3.5.8 test/system/workarea/admin/comments_system_test.rb
workarea-admin-3.5.7 test/system/workarea/admin/comments_system_test.rb
workarea-admin-3.5.6 test/system/workarea/admin/comments_system_test.rb
workarea-admin-3.5.5 test/system/workarea/admin/comments_system_test.rb
workarea-admin-3.5.4 test/system/workarea/admin/comments_system_test.rb
workarea-admin-3.5.3 test/system/workarea/admin/comments_system_test.rb
workarea-admin-3.5.2 test/system/workarea/admin/comments_system_test.rb
workarea-admin-3.5.1 test/system/workarea/admin/comments_system_test.rb
workarea-admin-3.5.0 test/system/workarea/admin/comments_system_test.rb
workarea-admin-3.5.0.beta.1 test/system/workarea/admin/comments_system_test.rb