Sha256: dedbcd850d6615add909534c724af304b70da2cc08163da7ceb1f9df92b6fdd4

Contents?: true

Size: 1010 Bytes

Versions: 2

Compression:

Stored size: 1010 Bytes

Contents

# frozen_string_literal: true

require "rails_helper"

module Archangel
  RSpec.describe FlashHelper, type: :helper do
    context "#flash_class_for(obj)" do
      it "returns success class" do
        expect(helper.flash_class_for("success")).to eq("success")
      end

      it "returns `error` class" do
        expect(helper.flash_class_for("error")).to eq("danger")
      end

      it "returns `alert` class" do
        expect(helper.flash_class_for("alert")).to eq("warning")
      end

      it "returns `notice` class" do
        expect(helper.flash_class_for("notice")).to eq("info")
      end

      it "returns unknown class" do
        expect(helper.flash_class_for("unknown")).to eq("unknown")
        expect(helper.flash_class_for("foo bar")).to eq("foo-bar")
        expect(helper.flash_class_for("foo-bar")).to eq("foo-bar")
        expect(helper.flash_class_for("foo_bar")).to eq("foo_bar")
        expect(helper.flash_class_for("foo      bar")).to eq("foo-bar")
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
archangel-0.0.8 spec/helpers/archangel/flash_helper_spec.rb
archangel-0.0.7 spec/helpers/archangel/flash_helper_spec.rb