Sha256: e3859ce38dfbe1cc1952d9ebc66b9a7e2a60a50a2b68281dfa826260dbc0c8c2

Contents?: true

Size: 670 Bytes

Versions: 18

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

18 entries across 18 versions & 2 rubygems

Version Path
doorkeeper-sequel-1.3.1 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-sequel-1.3.0 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-sequel-1.2.3 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-sequel-1.2.2 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-4.2.6 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-4.2.5 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-sequel-1.2.1 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-4.2.0 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-4.1.0 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-4.0.0 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-4.0.0.rc4 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-4.0.0.rc3 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-4.0.0.rc2 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-4.0.0.rc1 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-3.1.0 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-3.0.1 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-3.0.0 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-3.0.0.rc2 spec/helpers/doorkeeper/dashboard_helper_spec.rb