Sha256: 97febd7545afb57a9c76e6ea9031614948686ba37f15e5930f64d3a1982d85c3

Contents?: true

Size: 696 Bytes

Versions: 5

Compression:

Stored size: 696 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

RSpec.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

5 entries across 5 versions & 2 rubygems

Version Path
doorkeeper-mongodb-5.3.0 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-mongodb-5.2.3 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-sequel-2.4.0 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-mongodb-5.2.2 spec/helpers/doorkeeper/dashboard_helper_spec.rb
doorkeeper-sequel-2.3.0 spec/helpers/doorkeeper/dashboard_helper_spec.rb