Sha256: 9cc5cec38ef7f2b731ae88901182bc0846ba52aff166a161bf505578e245156c

Contents?: true

Size: 623 Bytes

Versions: 9

Compression:

Stored size: 623 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

module RailsWorkflow
  RSpec.describe Error, type: :model do
    describe '#can_restart_process?' do
      let(:process) { RailsWorkflow::Process.create }
      before do
        allow(subject).to receive(:process).and_return(process)
      end

      it { expect(subject.can_restart_process?).to eq true }

      context 'with errors' do
        before do
          allow(process).to receive(
            :unresolved_errors
          ).and_return ['some_error']
        end

        it { expect(subject.can_restart_process?).to eq false }
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rails_workflow-0.7.3 spec/models/rails_workflow/error_spec.rb
rails_workflow-0.7.2 spec/models/rails_workflow/error_spec.rb
rails_workflow-0.7.1 spec/models/rails_workflow/error_spec.rb
rails_workflow-0.7.0 spec/models/rails_workflow/error_spec.rb
rails_workflow-0.4.4 spec/models/rails_workflow/error_spec.rb
rails_workflow-0.4.3 spec/models/rails_workflow/error_spec.rb
rails_workflow-0.4.2 spec/models/rails_workflow/error_spec.rb
rails_workflow-0.4.1 spec/models/rails_workflow/error_spec.rb
rails_workflow-0.4.0 spec/models/rails_workflow/error_spec.rb