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.2.7.1 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.2.7.0 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.2.6.0 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.2.4.0 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.2.3.0 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.2.2.2 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.2.2.1 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.2.2.0 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.2.1.1 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.2.1.0 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.2.0.0 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.1.8.0 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.1.6.0 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.1.4.0 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.1.3.0 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.0.7.0 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-2.0.4.0 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-1.12.3.0 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-1.11.5.0 spec/helpers/semantic_flash_helper_spec.rb
semantic-ui-sass-1.11.4.1 spec/helpers/semantic_flash_helper_spec.rb