fomantic-ui-sass 2.6.4 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +1 -0
- data/.rubocop_todo.yml +102 -0
- data/.travis.yml +9 -3
- data/README.md +4 -2
- data/Rakefile +25 -3
- data/app/assets/fonts/semantic-ui/brand-icons.eot +0 -0
- data/app/assets/fonts/semantic-ui/brand-icons.svg +178 -11
- data/app/assets/fonts/semantic-ui/brand-icons.ttf +0 -0
- data/app/assets/fonts/semantic-ui/brand-icons.woff +0 -0
- data/app/assets/fonts/semantic-ui/brand-icons.woff2 +0 -0
- data/app/assets/fonts/semantic-ui/icons.eot +0 -0
- data/app/assets/fonts/semantic-ui/icons.svg +1138 -92
- data/app/assets/fonts/semantic-ui/icons.ttf +0 -0
- data/app/assets/fonts/semantic-ui/icons.woff +0 -0
- data/app/assets/fonts/semantic-ui/icons.woff2 +0 -0
- data/app/assets/fonts/semantic-ui/outline-icons.eot +0 -0
- data/app/assets/fonts/semantic-ui/outline-icons.svg +127 -26
- data/app/assets/fonts/semantic-ui/outline-icons.ttf +0 -0
- data/app/assets/fonts/semantic-ui/outline-icons.woff +0 -0
- data/app/assets/fonts/semantic-ui/outline-icons.woff2 +0 -0
- data/app/assets/javascripts/semantic-ui.js +1 -1
- data/app/assets/javascripts/semantic-ui/accordion.js +5 -1
- data/app/assets/javascripts/semantic-ui/api.js +9 -2
- data/app/assets/javascripts/semantic-ui/calendar.js +25 -12
- data/app/assets/javascripts/semantic-ui/checkbox.js +39 -2
- data/app/assets/javascripts/semantic-ui/dimmer.js +25 -5
- data/app/assets/javascripts/semantic-ui/dropdown.js +130 -47
- data/app/assets/javascripts/semantic-ui/embed.js +5 -1
- data/app/assets/javascripts/semantic-ui/form.js +24 -19
- data/app/assets/javascripts/semantic-ui/modal.js +33 -17
- data/app/assets/javascripts/semantic-ui/nag.js +5 -1
- data/app/assets/javascripts/semantic-ui/popup.js +10 -5
- data/app/assets/javascripts/semantic-ui/progress.js +5 -1
- data/app/assets/javascripts/semantic-ui/rating.js +21 -6
- data/app/assets/javascripts/semantic-ui/search.js +43 -27
- data/app/assets/javascripts/semantic-ui/shape.js +5 -1
- data/app/assets/javascripts/semantic-ui/sidebar.js +7 -3
- data/app/assets/javascripts/semantic-ui/site.js +6 -2
- data/app/assets/javascripts/semantic-ui/slider.js +1216 -0
- data/app/assets/javascripts/semantic-ui/state.js +5 -1
- data/app/assets/javascripts/semantic-ui/sticky.js +5 -1
- data/app/assets/javascripts/semantic-ui/tab.js +10 -3
- data/app/assets/javascripts/semantic-ui/toast.js +6 -2
- data/app/assets/javascripts/semantic-ui/transition.js +6 -2
- data/app/assets/javascripts/semantic-ui/visibility.js +6 -2
- data/app/assets/stylesheets/semantic-ui/collections/_breadcrumb.scss +7 -7
- data/app/assets/stylesheets/semantic-ui/collections/_form.scss +59 -83
- data/app/assets/stylesheets/semantic-ui/collections/_grid.scss +110 -124
- data/app/assets/stylesheets/semantic-ui/collections/_menu.scss +262 -237
- data/app/assets/stylesheets/semantic-ui/collections/_message.scss +155 -118
- data/app/assets/stylesheets/semantic-ui/collections/_table.scss +332 -145
- data/app/assets/stylesheets/semantic-ui/elements/_button.scss +2281 -2415
- data/app/assets/stylesheets/semantic-ui/elements/_container.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/elements/_divider.scss +10 -10
- data/app/assets/stylesheets/semantic-ui/elements/_flag.scss +81 -81
- data/app/assets/stylesheets/semantic-ui/elements/_header.scss +178 -191
- data/app/assets/stylesheets/semantic-ui/elements/_icon.scss +71 -103
- data/app/assets/stylesheets/semantic-ui/elements/_image.scss +8 -8
- data/app/assets/stylesheets/semantic-ui/elements/_input.scss +61 -40
- data/app/assets/stylesheets/semantic-ui/elements/_label.scss +1087 -444
- data/app/assets/stylesheets/semantic-ui/elements/_list.scss +69 -69
- data/app/assets/stylesheets/semantic-ui/elements/_loader.scss +510 -155
- data/app/assets/stylesheets/semantic-ui/elements/_placeholder.scss +20 -14
- data/app/assets/stylesheets/semantic-ui/elements/_rail.scss +26 -26
- data/app/assets/stylesheets/semantic-ui/elements/_reveal.scss +8 -8
- data/app/assets/stylesheets/semantic-ui/elements/_segment.scss +180 -216
- data/app/assets/stylesheets/semantic-ui/elements/_step.scss +34 -39
- data/app/assets/stylesheets/semantic-ui/elements/_text.scss +114 -0
- data/app/assets/stylesheets/semantic-ui/globals/_reset.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/globals/_site.scss +11 -20
- data/app/assets/stylesheets/semantic-ui/modules/_accordion.scss +16 -16
- data/app/assets/stylesheets/semantic-ui/modules/_all.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/modules/_calendar.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/modules/_checkbox.scss +23 -23
- data/app/assets/stylesheets/semantic-ui/modules/_dimmer.scss +32 -32
- data/app/assets/stylesheets/semantic-ui/modules/_dropdown.scss +128 -155
- data/app/assets/stylesheets/semantic-ui/modules/_embed.scss +13 -13
- data/app/assets/stylesheets/semantic-ui/modules/_modal.scss +50 -48
- data/app/assets/stylesheets/semantic-ui/modules/_nag.scss +15 -15
- data/app/assets/stylesheets/semantic-ui/modules/_popup.scss +50 -50
- data/app/assets/stylesheets/semantic-ui/modules/_progress.scss +30 -44
- data/app/assets/stylesheets/semantic-ui/modules/_rating.scss +137 -111
- data/app/assets/stylesheets/semantic-ui/modules/_search.scss +24 -28
- data/app/assets/stylesheets/semantic-ui/modules/_shape.scss +6 -6
- data/app/assets/stylesheets/semantic-ui/modules/_sidebar.scss +29 -29
- data/app/assets/stylesheets/semantic-ui/modules/_slider.scss +768 -0
- data/app/assets/stylesheets/semantic-ui/modules/_sticky.scss +3 -3
- data/app/assets/stylesheets/semantic-ui/modules/_tab.scss +10 -14
- data/app/assets/stylesheets/semantic-ui/modules/_toast.scss +27 -16
- data/app/assets/stylesheets/semantic-ui/modules/_transition.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/views/_ad.scss +6 -6
- data/app/assets/stylesheets/semantic-ui/views/_card.scss +103 -133
- data/app/assets/stylesheets/semantic-ui/views/_comment.scss +26 -26
- data/app/assets/stylesheets/semantic-ui/views/_feed.scss +27 -27
- data/app/assets/stylesheets/semantic-ui/views/_item.scss +54 -54
- data/app/assets/stylesheets/semantic-ui/views/_statistic.scss +138 -108
- data/app/helpers/semantic_breadcrumbs_helper.rb +1 -1
- data/app/helpers/semantic_flash_helper.rb +4 -2
- data/app/helpers/semantic_icon_helper.rb +1 -1
- data/fomantic-ui-sass.gemspec +20 -19
- data/gemfiles/rails_5.0.gemfile +5 -0
- data/gemfiles/rails_5.1.gemfile +5 -0
- data/gemfiles/rails_5.2.gemfile +5 -0
- data/lib/fomantic-ui-sass.rb +3 -4
- data/lib/fomantic/ui/sass/breadcrumbs.rb +2 -4
- data/lib/fomantic/ui/sass/engine.rb +3 -3
- data/lib/fomantic/ui/sass/version.rb +2 -2
- data/spec/dummy/Rakefile +1 -1
- data/spec/dummy/bin/bundle +1 -1
- data/spec/dummy/bin/rails +1 -1
- data/spec/dummy/bin/rake +0 -0
- data/spec/dummy/config.ru +1 -1
- data/spec/dummy/config/application.rb +5 -6
- data/spec/dummy/config/boot.rb +3 -3
- data/spec/dummy/config/environment.rb +1 -1
- data/spec/dummy/config/environments/test.rb +1 -1
- data/spec/helpers/semantic_breadcrumbs_helper_spec.rb +30 -32
- data/spec/helpers/semantic_flash_helper_spec.rb +15 -16
- data/spec/helpers/semantic_icon_helper_spec.rb +10 -10
- data/spec/spec_helper.rb +4 -6
- data/tasks/converter.rb +61 -73
- data/templates/project/manifest.rb +1 -2
- metadata +45 -23
- data/app/assets/javascripts/semantic-ui/range.js +0 -278
- data/app/assets/stylesheets/semantic-ui/modules/_range.scss +0 -192
@@ -1,6 +1,6 @@
|
|
1
1
|
module SemanticBreadcrumbsHelper
|
2
2
|
def semantic_breadcrumbs(divider = '/', &block)
|
3
|
-
content = render :
|
3
|
+
content = render partial: 'semantic/breadcrumbs', layout: false, locals: { divider: divider }
|
4
4
|
if block_given?
|
5
5
|
capture(content, &block)
|
6
6
|
else
|
@@ -1,13 +1,15 @@
|
|
1
1
|
module SemanticFlashHelper
|
2
|
-
ALERT_TYPES = [
|
2
|
+
ALERT_TYPES = %i[error info success warning].freeze
|
3
3
|
|
4
4
|
def semantic_flash
|
5
5
|
output = ''
|
6
6
|
flash.each do |type, message|
|
7
7
|
next if message.blank?
|
8
|
+
|
8
9
|
type = :success if type.to_sym == :notice
|
9
10
|
type = :error if type.to_sym == :alert
|
10
11
|
next unless ALERT_TYPES.include?(type.to_sym)
|
12
|
+
|
11
13
|
output += flash_container(type, message)
|
12
14
|
end
|
13
15
|
|
@@ -16,7 +18,7 @@ module SemanticFlashHelper
|
|
16
18
|
|
17
19
|
def flash_container(type, message)
|
18
20
|
content_tag(:div, class: "ui #{type} message") do
|
19
|
-
content_tag(:i, '', class:
|
21
|
+
content_tag(:i, '', class: 'close icon') + message
|
20
22
|
end
|
21
23
|
end
|
22
24
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module SemanticIconHelper
|
2
2
|
def semantic_icon(*names)
|
3
3
|
opts = names[-1].is_a?(Hash) ? names.delete_at(-1) : {}
|
4
|
-
icon_classes = names.map{|name|
|
4
|
+
icon_classes = names.map { |name| name.to_s.tr('_', '-').to_s } << 'icon'
|
5
5
|
opts[:class] = [opts[:class], icon_classes].flatten.reject(&:nil?)
|
6
6
|
content_tag :i, nil, opts
|
7
7
|
end
|
data/fomantic-ui-sass.gemspec
CHANGED
@@ -1,31 +1,32 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
require 'fomantic/ui/sass/version'
|
5
4
|
|
6
5
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
6
|
+
spec.name = 'fomantic-ui-sass'
|
8
7
|
spec.version = Fomantic::Ui::Sass::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
11
|
-
spec.description =
|
12
|
-
spec.summary =
|
13
|
-
spec.homepage =
|
14
|
-
spec.license =
|
8
|
+
spec.authors = %w[doabit shanecav84]
|
9
|
+
spec.email = ['doinsist@gmail.com', 'shane@shanecav.net']
|
10
|
+
spec.description = 'Fomantic UI, converted to Sass and ready to drop into Rails, Compass, or Sprockets.'
|
11
|
+
spec.summary = 'Fomantic UI, converted to Sass and ready to drop into Rails, Compass, or Sprockets.'
|
12
|
+
spec.homepage = 'http://github.com/shanecav84/fomantic-ui-sass'
|
13
|
+
spec.license = 'MIT'
|
15
14
|
|
16
|
-
spec.files = `git ls-files`.split(
|
15
|
+
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
17
16
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = [
|
18
|
+
spec.require_paths = ['lib']
|
20
19
|
|
21
|
-
spec.
|
22
|
-
spec.
|
23
|
-
spec.add_runtime_dependency
|
24
|
-
spec.
|
25
|
-
spec.
|
26
|
-
|
20
|
+
spec.add_runtime_dependency 'autoprefixer-rails'
|
21
|
+
spec.add_runtime_dependency 'rails', '>= 3.2.0'
|
22
|
+
spec.add_runtime_dependency 'sass', '>= 3.2'
|
23
|
+
spec.add_runtime_dependency 'sass-rails', '>= 3.2'
|
24
|
+
spec.add_runtime_dependency 'sprockets-rails', '>= 2.1.3'
|
25
|
+
|
26
|
+
spec.add_development_dependency 'bundler', '>= 1.3'
|
27
27
|
spec.add_development_dependency 'dotenv'
|
28
|
+
spec.add_development_dependency 'pry'
|
29
|
+
spec.add_development_dependency 'rake'
|
28
30
|
spec.add_development_dependency 'rspec-rails', '>= 3.0'
|
29
|
-
spec.add_development_dependency
|
30
|
-
spec.add_development_dependency "autoprefixer-rails"
|
31
|
+
spec.add_development_dependency 'rubocop'
|
31
32
|
end
|
data/lib/fomantic-ui-sass.rb
CHANGED
@@ -7,7 +7,7 @@ module Fomantic
|
|
7
7
|
if defined?(::Rails)
|
8
8
|
require 'fomantic/ui/sass/engine'
|
9
9
|
elsif defined?(::Compass)
|
10
|
-
::Compass::Frameworks.register('fomantic-ui', :
|
10
|
+
::Compass::Frameworks.register('fomantic-ui', path: base, stylesheets_directory: stylesheets_path, templates_directory: templates_path)
|
11
11
|
elsif defined?(::Sprockets)
|
12
12
|
Sprockets.append_path(stylesheets_path)
|
13
13
|
Sprockets.append_path(fonts_path)
|
@@ -16,8 +16,8 @@ module Fomantic
|
|
16
16
|
end
|
17
17
|
|
18
18
|
configure_sass
|
19
|
-
|
20
|
-
raise Fomantic::Ui::Sass::FrameworkNotFound,
|
19
|
+
unless defined?(::Rails) || defined?(::Compass) || defined?(::Sprockets)
|
20
|
+
raise Fomantic::Ui::Sass::FrameworkNotFound, 'fomantic-ui-sass requires either Rails > 3.1 or Compass, or Sprockets, none of which are loaded'
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -54,7 +54,6 @@ module Fomantic
|
|
54
54
|
require 'sass'
|
55
55
|
::Sass.load_paths << stylesheets_path
|
56
56
|
end
|
57
|
-
|
58
57
|
end
|
59
58
|
end
|
60
59
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
module Fomantic
|
2
2
|
module Ui
|
3
3
|
module Sass
|
4
|
-
|
5
4
|
module BreadCrumbs
|
6
5
|
def self.included(base)
|
7
6
|
base.extend(ClassMethods)
|
@@ -23,7 +22,7 @@ module Fomantic
|
|
23
22
|
@breadcrumbs ||= []
|
24
23
|
name = translate_semantic_breadcrumb(name, self.class.name) if name.is_a?(Symbol)
|
25
24
|
url = eval(url.to_s) if url =~ /_path|_url|@/
|
26
|
-
|
25
|
+
@breadcrumbs << { name: name, url: url, options: options }
|
27
26
|
end
|
28
27
|
|
29
28
|
def translate_semantic_breadcrumb(name, class_name)
|
@@ -32,10 +31,9 @@ module Fomantic
|
|
32
31
|
namespace.last.sub!('_controller', '')
|
33
32
|
scope += namespace
|
34
33
|
|
35
|
-
I18n.t name, :
|
34
|
+
I18n.t name, scope: scope
|
36
35
|
end
|
37
36
|
end
|
38
|
-
|
39
37
|
end
|
40
38
|
end
|
41
39
|
end
|
@@ -4,11 +4,11 @@ module Fomantic
|
|
4
4
|
module Sass
|
5
5
|
module Rails
|
6
6
|
class Engine < ::Rails::Engine
|
7
|
-
initializer
|
7
|
+
initializer 'fomantic-ui-sass.assets.precompile' do |app|
|
8
8
|
if ::Rails.version >= '5' || ::Sprockets::VERSION.start_with?('4')
|
9
|
-
::Rails.application.config.assets.precompile += %w
|
9
|
+
::Rails.application.config.assets.precompile += %w[semantic-ui/*icons.*]
|
10
10
|
else
|
11
|
-
app.config.assets.precompile << %r
|
11
|
+
app.config.assets.precompile << %r{semantic-ui\/(basic\.)*icons\.(?:eot|svg|ttf|woff)$}
|
12
12
|
end
|
13
13
|
end
|
14
14
|
initializer 'fomantic-ui-sass.setup_helpers' do |app|
|
data/spec/dummy/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
2
|
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
3
|
|
4
|
-
require File.expand_path('
|
4
|
+
require File.expand_path('config/application', __dir__)
|
5
5
|
|
6
6
|
Dummy::Application.load_tasks
|
data/spec/dummy/bin/bundle
CHANGED
data/spec/dummy/bin/rails
CHANGED
data/spec/dummy/bin/rake
CHANGED
File without changes
|
data/spec/dummy/config.ru
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
require File.expand_path('
|
1
|
+
require File.expand_path('boot', __dir__)
|
2
2
|
|
3
3
|
# Pick the frameworks you want:
|
4
4
|
# require "active_record/railtie"
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
5
|
+
require 'action_controller/railtie'
|
6
|
+
require 'action_mailer/railtie'
|
7
|
+
require 'sprockets/railtie'
|
8
8
|
# require "rails/test_unit/railtie"
|
9
9
|
|
10
10
|
Bundler.require(*Rails.groups)
|
11
|
-
require
|
11
|
+
require 'fomantic-ui-sass'
|
12
12
|
|
13
13
|
module Dummy
|
14
14
|
class Application < Rails::Application
|
@@ -25,4 +25,3 @@ module Dummy
|
|
25
25
|
# config.i18n.default_locale = :de
|
26
26
|
end
|
27
27
|
end
|
28
|
-
|
data/spec/dummy/config/boot.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Set up gems listed in the Gemfile.
|
2
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('
|
2
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
|
3
3
|
|
4
|
-
require 'bundler/setup' if File.
|
5
|
-
$LOAD_PATH.unshift File.expand_path('
|
4
|
+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
5
|
+
$LOAD_PATH.unshift File.expand_path('../../../lib', __dir__)
|
@@ -13,7 +13,7 @@ Dummy::Application.configure do
|
|
13
13
|
config.eager_load = false
|
14
14
|
|
15
15
|
# Configure static asset server for tests with Cache-Control for performance.
|
16
|
-
config.serve_static_assets
|
16
|
+
config.serve_static_assets = true
|
17
17
|
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
|
18
18
|
|
19
19
|
# Show full error reports and disable caching.
|
@@ -1,38 +1,36 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe SemanticBreadcrumbsHelper do
|
4
|
-
describe
|
4
|
+
describe 'semantic_breadcrumbs' do
|
5
|
+
it 'should return breadcrumbs' do
|
6
|
+
controller.instance_variable_set('@breadcrumbs', [{ name: 'Home', url: '/' }])
|
7
|
+
expect(semantic_breadcrumbs).to like_of %(
|
8
|
+
<div class="ui breadcrumb">
|
9
|
+
<div class="active section">Home</div>
|
10
|
+
</div>
|
11
|
+
)
|
12
|
+
end
|
5
13
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
<
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
+
it 'should return breadcrumbs with multi params' do
|
15
|
+
controller.instance_variable_set('@breadcrumbs', [{ name: 'Home', url: '/' }, { name: 'Posts', url: '/posts' }])
|
16
|
+
expect(semantic_breadcrumbs).to like_of %(
|
17
|
+
<div class="ui breadcrumb">
|
18
|
+
<a href="/">Home</a>
|
19
|
+
<div class="divider">/</div>
|
20
|
+
<div class="active section">Posts</div>
|
21
|
+
</div>
|
22
|
+
)
|
23
|
+
end
|
14
24
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
it "should return breadcrumbs with divider" do
|
27
|
-
controller.instance_variable_set("@breadcrumbs", [{name: 'Home', url:'/'}, {name: 'Posts', url: '/posts'}])
|
28
|
-
expect(semantic_breadcrumbs('>')).to like_of %Q{
|
29
|
-
<div class="ui breadcrumb">
|
30
|
-
<a href="/">Home</a>
|
31
|
-
<div class="divider">></div>
|
32
|
-
<div class="active section">Posts</div>
|
33
|
-
</div>
|
34
|
-
}
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
25
|
+
it 'should return breadcrumbs with divider' do
|
26
|
+
controller.instance_variable_set('@breadcrumbs', [{ name: 'Home', url: '/' }, { name: 'Posts', url: '/posts' }])
|
27
|
+
expect(semantic_breadcrumbs('>')).to like_of %(
|
28
|
+
<div class="ui breadcrumb">
|
29
|
+
<a href="/">Home</a>
|
30
|
+
<div class="divider">></div>
|
31
|
+
<div class="active section">Posts</div>
|
32
|
+
</div>
|
33
|
+
)
|
34
|
+
end
|
35
|
+
end
|
38
36
|
end
|
@@ -1,36 +1,35 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe SemanticFlashHelper do
|
4
|
-
describe
|
5
|
-
|
6
|
-
|
7
|
-
@request.flash[:warning] = "Update Warning!"
|
4
|
+
describe 'semantic_flash' do
|
5
|
+
it 'should return warning flash message' do
|
6
|
+
@request.flash[:warning] = 'Update Warning!'
|
8
7
|
expect(semantic_flash).to eq '<div class="ui warning message"><i class="close icon"></i>Update Warning!</div>'
|
9
8
|
end
|
10
9
|
|
11
|
-
it
|
12
|
-
@request.flash[:notice] =
|
10
|
+
it 'should return alert-success message when using notice message' do
|
11
|
+
@request.flash[:notice] = 'Update Success!'
|
13
12
|
expect(semantic_flash).to eq '<div class="ui success message"><i class="close icon"></i>Update Success!</div>'
|
14
13
|
end
|
15
14
|
|
16
|
-
it
|
17
|
-
@request.flash[:alert] =
|
15
|
+
it 'should return error message when using notice alert' do
|
16
|
+
@request.flash[:alert] = 'Update Failed!'
|
18
17
|
expect(semantic_flash).to eq '<div class="ui error message"><i class="close icon"></i>Update Failed!</div>'
|
19
18
|
end
|
20
19
|
|
21
|
-
it
|
22
|
-
@request.flash[:error] =
|
20
|
+
it 'should return alert-error message when using notice error' do
|
21
|
+
@request.flash[:error] = 'Update Failed!'
|
23
22
|
expect(semantic_flash).to eq '<div class="ui error message"><i class="close icon"></i>Update Failed!</div>'
|
24
23
|
end
|
25
24
|
|
26
|
-
it
|
27
|
-
@request.flash[:undefined] =
|
28
|
-
expect(semantic_flash).to eq
|
25
|
+
it 'should return no message when using an undefined message' do
|
26
|
+
@request.flash[:undefined] = 'Update Undefined!'
|
27
|
+
expect(semantic_flash).to eq ''
|
29
28
|
end
|
30
29
|
|
31
|
-
it
|
32
|
-
@request.flash[:notice] =
|
33
|
-
expect(semantic_flash).to eq
|
30
|
+
it 'should return no message when the message is blank' do
|
31
|
+
@request.flash[:notice] = ''
|
32
|
+
expect(semantic_flash).to eq ''
|
34
33
|
end
|
35
34
|
end
|
36
35
|
end
|
@@ -1,47 +1,47 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe SemanticIconHelper do
|
4
|
-
it
|
4
|
+
it 'render icon with name' do
|
5
5
|
render plain: semantic_icon('add')
|
6
6
|
assert_select 'i[class="add icon"]'
|
7
7
|
end
|
8
8
|
|
9
|
-
it
|
9
|
+
it 'render icon with names with string' do
|
10
10
|
render plain: semantic_icon('add sign')
|
11
11
|
assert_select 'i[class="add sign icon"]'
|
12
12
|
end
|
13
13
|
|
14
|
-
it
|
14
|
+
it 'render icon with names with params' do
|
15
15
|
render plain: semantic_icon('add', 'sign')
|
16
16
|
assert_select 'i[class="add sign icon"]'
|
17
17
|
end
|
18
18
|
|
19
|
-
it
|
19
|
+
it 'render icon with names with sym params' do
|
20
20
|
render plain: semantic_icon(:add, :sign)
|
21
21
|
assert_select 'i[class="add sign icon"]'
|
22
22
|
end
|
23
23
|
|
24
|
-
it
|
24
|
+
it 'render icon with name and id' do
|
25
25
|
render plain: semantic_icon('add', id: 'id')
|
26
26
|
assert_select 'i[class="add icon"][id="id"]'
|
27
27
|
end
|
28
28
|
|
29
|
-
it
|
30
|
-
render plain: semantic_icon('add', id: 'id', data: {foo: 'bar'})
|
29
|
+
it 'render icon with arbitrary attributes' do
|
30
|
+
render plain: semantic_icon('add', id: 'id', data: { foo: 'bar' })
|
31
31
|
assert_select 'i[class="add icon"][id="id"][data-foo="bar"]'
|
32
32
|
end
|
33
33
|
|
34
|
-
it
|
34
|
+
it 'render icon with names with string and id' do
|
35
35
|
render plain: semantic_icon('add sign', id: 'id')
|
36
36
|
assert_select 'i[class="add sign icon"][id="id"]'
|
37
37
|
end
|
38
38
|
|
39
|
-
it
|
39
|
+
it 'render icon with names with params and id' do
|
40
40
|
render plain: semantic_icon('add', 'sign', id: 'id')
|
41
41
|
assert_select 'i[class="add sign icon"][id="id"]'
|
42
42
|
end
|
43
43
|
|
44
|
-
it
|
44
|
+
it 'render icon with names with sym params and id' do
|
45
45
|
render plain: semantic_icon(:add, :sign, id: 'id')
|
46
46
|
assert_select 'i[class="add sign icon"][id="id"]'
|
47
47
|
end
|