Sha256: f14e5ab55233c8d0296414085c16859abc915a2cb29379381681f90f30a0b772

Contents?: true

Size: 755 Bytes

Versions: 62

Compression:

Stored size: 755 Bytes

Contents

require 'test_helper'

module Workarea
  class PublishBulkActionTest < Workarea::TestCase
    cattr_accessor :raise_error

    class TestAction < BulkAction
      def perform!
        raise 'foo' if PublishBulkActionTest.raise_error
      end
    end

    def test_perform_marks_the_update_completed
      self.class.raise_error = false
      action = TestAction.create!(ids: %w(foo bar))
      PublishBulkAction.new.perform(action.id)
      assert(action.reload.completed?)
    end

    def test_perform_marks_the_update_as_completed_with_error
      self.class.raise_error = true
      action = TestAction.create!(ids: %w(foo bar))
      assert_raise { PublishBulkAction.new.perform(action.id) }
      assert(action.reload.completed?)
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.15 test/workers/workarea/publish_bulk_action_test.rb
workarea-core-3.4.36 test/workers/workarea/publish_bulk_action_test.rb
workarea-core-3.5.14 test/workers/workarea/publish_bulk_action_test.rb
workarea-core-3.4.35 test/workers/workarea/publish_bulk_action_test.rb
workarea-core-3.5.13 test/workers/workarea/publish_bulk_action_test.rb
workarea-core-3.4.34 test/workers/workarea/publish_bulk_action_test.rb
workarea-core-3.5.12 test/workers/workarea/publish_bulk_action_test.rb
workarea-core-3.4.33 test/workers/workarea/publish_bulk_action_test.rb
workarea-core-3.5.11 test/workers/workarea/publish_bulk_action_test.rb
workarea-core-3.5.10 test/workers/workarea/publish_bulk_action_test.rb
workarea-core-3.4.32 test/workers/workarea/publish_bulk_action_test.rb
workarea-core-3.5.9 test/workers/workarea/publish_bulk_action_test.rb
workarea-core-3.4.31 test/workers/workarea/publish_bulk_action_test.rb
workarea-core-3.5.8 test/workers/workarea/publish_bulk_action_test.rb
workarea-core-3.4.30 test/workers/workarea/publish_bulk_action_test.rb
workarea-core-3.5.7 test/workers/workarea/publish_bulk_action_test.rb
workarea-core-3.4.29 test/workers/workarea/publish_bulk_action_test.rb
workarea-core-3.5.6 test/workers/workarea/publish_bulk_action_test.rb
workarea-core-3.4.28 test/workers/workarea/publish_bulk_action_test.rb
workarea-core-3.5.5 test/workers/workarea/publish_bulk_action_test.rb