Sha256: 38ebdbed54d9a6f1aaee2523671aaaf236359c1d70b1973d38bcb212e47fd698

Contents?: true

Size: 670 Bytes

Versions: 13

Compression:

Stored size: 670 Bytes

Contents

require 'spec_helper_integration'

describe Doorkeeper::DashboardHelper do
  describe '#doorkeeper_errors_for' do
    let(:object) { double errors: { method: messages } }
    let(:messages) { ['first message', 'second message'] }

    context 'when object has errors' do
      it 'returns error messages' do
        messages.each do |message|
          expect(helper.doorkeeper_errors_for(object, :method)).to include(
            message.capitalize
          )
        end
      end
    end

    context 'when object has no errors' do
      it 'returns nil' do
        expect(helper.doorkeeper_errors_for(object, :amonter_method)).to be_nil
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
doorkeeper-mongodb-4.2.0 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-sequel-1.5.0 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-4.4.3 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-4.4.2 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-4.4.1 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-4.4.0 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-mongodb-4.1.0 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-4.3.2 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-4.3.1 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-4.3.0 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-sequel-1.4.0 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-mongodb-4.0.1 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-mongodb-4.0.0 spec/helpers/doorkeeper/dashboard_helper_spec.rb