Sha256: b94bdc658ea66eeab4d46cf2e32f4e4e3eaac4d2e59fa680bdd5e4691a650ed4

Contents?: true

Size: 690 Bytes

Versions: 7

Compression:

Stored size: 690 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

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

7 entries across 7 versions & 2 rubygems

Version Path
doorkeeper-5.3.3 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-5.3.2 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-5.4.0.rc1 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-mongodb-5.2.1 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-mongodb-5.2.0 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-5.3.1 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-5.3.0 spec/helpers/doorkeeper/dashboard_helper_spec.rb