Sha256: ff66a2f3a461456cc38fb659262c6ad4048d7049a3cde9116e69f6c8d62afa7b

Contents?: true

Size: 1.33 KB

Versions: 46

Compression:

Stored size: 1.33 KB

Contents

require 'spec_helper'

describe SemanticFlashHelper do
  describe "semantic_flash" do

    it "should return warning flash message" do
      @request.flash[:warning] = "Update Warning!"
      expect(semantic_flash).to eq '<div class="ui warning message"><i class="close icon"></i>Update Warning!</div>'
    end

    it "should return alert-success message when using notice message" do
      @request.flash[:notice] = "Update Success!"
      expect(semantic_flash).to eq '<div class="ui success message"><i class="close icon"></i>Update Success!</div>'
    end

    it "should return error message when using notice alert" do
      @request.flash[:alert] = "Update Failed!"
      expect(semantic_flash).to eq '<div class="ui error message"><i class="close icon"></i>Update Failed!</div>'
    end

    it "should return alert-error message when using notice error" do
      @request.flash[:error] = "Update Failed!"
      expect(semantic_flash).to eq '<div class="ui error message"><i class="close icon"></i>Update Failed!</div>'
    end

    it "should return no message when using an undefined message" do
      @request.flash[:undefined] = "Update Undefined!"
      expect(semantic_flash).to eq ""
    end

    it "should return no message when the message is blank" do
      @request.flash[:notice] = ""
      expect(semantic_flash).to eq ""
    end
  end
end

Version data entries

46 entries across 46 versions & 2 rubygems

Version Path
semantic-ui-sass-2.4.4.0 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.4.3.0 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.4.2.0 spec/helpers/semantic_flash_helper_spec.rb
fomantic-ui-sass-2.6.4 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.4.0.1 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.4.0.0 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.3.1.2 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.3.1.1 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.3.1.0 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.3.0.0 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.2.14 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.2.12.1 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.2.12.0 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.2.11.0 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.2.10.1 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.2.10.0 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.2.9.3 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.2.9.2 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.2.9.1 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.2.9.0 spec/helpers/semantic_flash_helper_spec.rb