bootstrap_leather 0.9.4 → 0.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rspec +1 -0
- data/.rubocop.yml +23 -0
- data/.rubocop_todo.yml +12 -0
- data/.ruby-gemset +1 -1
- data/.ruby-version +1 -1
- data/.travis.yml +5 -0
- data/Gemfile +40 -7
- data/LICENSE.txt +1 -1
- data/README.md +260 -0
- data/Rakefile +35 -20
- data/VERSION +1 -1
- data/app/helpers/bootstrap_leather/alerts_helper.rb +36 -0
- data/app/helpers/bootstrap_leather/application_helper.rb +21 -0
- data/app/helpers/bootstrap_leather/badges_helper.rb +21 -0
- data/app/helpers/bootstrap_leather/carousels_helper.rb +32 -0
- data/app/helpers/bootstrap_leather/foot_helper.rb +14 -0
- data/app/helpers/bootstrap_leather/grid_helper.rb +10 -0
- data/app/helpers/bootstrap_leather/head_helper.rb +67 -0
- data/app/helpers/bootstrap_leather/hero_unit_helper.rb +14 -0
- data/app/helpers/bootstrap_leather/icons_helper.rb +33 -0
- data/app/helpers/bootstrap_leather/modals_helper.rb +20 -0
- data/app/helpers/bootstrap_leather/navigation_helper.rb +71 -0
- data/app/helpers/bootstrap_leather/tabs_helper.rb +28 -0
- data/app/helpers/bootstrap_leather/thumbnails_helper.rb +13 -0
- data/app/helpers/bootstrap_leather/typography_helper.rb +38 -0
- data/app/helpers/bootstrap_leather/widgets_helper.rb +29 -0
- data/app/views/bootstrap_leather/{_alert.html.haml → alerts/_alert.html.haml} +1 -1
- data/app/views/bootstrap_leather/{_alert_flash_messages.html.haml → alerts/_alert_flash_messages.html.haml} +0 -0
- data/app/views/bootstrap_leather/{_badge.html.haml → badges/_badge.html.haml} +1 -1
- data/app/views/bootstrap_leather/badges/_badge_to.html.haml +3 -0
- data/app/views/bootstrap_leather/{_carousel.html.haml → carousels/_carousel.html.haml} +0 -0
- data/app/views/bootstrap_leather/{_carousel_with_thumbnails.html.haml → carousels/_carousel_with_thumbnails.html.haml} +0 -0
- data/app/views/bootstrap_leather/{_footer_javascript.html.haml → foot/_footer_javascript.html.haml} +0 -0
- data/app/views/bootstrap_leather/{_head_css.html.haml → head/_head_css.html.haml} +0 -0
- data/app/views/bootstrap_leather/{_hero_unit.html.haml → hero_unit/_hero_unit.html.haml} +0 -0
- data/app/views/bootstrap_leather/{_icon.html.haml → icons/_icon.html.haml} +0 -0
- data/app/views/bootstrap_leather/{_icon_button_to.html.haml → icons/_icon_button_to.html.haml} +0 -0
- data/app/views/bootstrap_leather/{_icon_link_to.html.haml → icons/_icon_link_to.html.haml} +0 -0
- data/app/views/bootstrap_leather/{_modal.html.haml → modals/_modal.html.haml} +2 -2
- data/app/views/bootstrap_leather/navigation/_dropdown_nav_item.html.haml +6 -0
- data/app/views/bootstrap_leather/navigation/_hamburger_menu.html.haml +6 -0
- data/app/views/bootstrap_leather/{_logo_and_title.html.haml → navigation/_logo_and_title.html.haml} +0 -0
- data/app/views/bootstrap_leather/{_nav_heading.html.haml → navigation/_nav_heading.html.haml} +0 -0
- data/app/views/bootstrap_leather/{_nav_item.html.haml → navigation/_nav_item.html.haml} +0 -0
- data/app/views/bootstrap_leather/{_nav_list.html.haml → navigation/_nav_list.html.haml} +0 -0
- data/app/views/bootstrap_leather/navigation/_navbar.html.haml +14 -0
- data/app/views/bootstrap_leather/navigation/_navbar_contents.html.haml +5 -0
- data/app/views/bootstrap_leather/tabs/_tabs.html.haml +10 -0
- data/app/views/bootstrap_leather/{_thumbnail.html.haml → thumbnails/_thumbnail.html.haml} +0 -0
- data/app/views/bootstrap_leather/{_definition_list.html.haml → typography/_dl.html.haml} +0 -0
- data/app/views/bootstrap_leather/{_page_header.html.haml → typography/_page_header.html.haml} +1 -1
- data/app/views/bootstrap_leather/widgets/_widgets.html.haml +10 -0
- data/bin/rails +15 -0
- data/bootstrap_leather.gemspec +219 -57
- data/config/locales/en.yml +9 -0
- data/lib/bootstrap_leather/configuration.rb +16 -12
- data/lib/bootstrap_leather/engine.rb +19 -4
- data/lib/bootstrap_leather/localization.rb +20 -18
- data/lib/bootstrap_leather/version.rb +4 -1
- data/lib/bootstrap_leather.rb +6 -2
- data/lib/generators/bootstrap_leather/install/install_generator.rb +21 -19
- data/lib/generators/bootstrap_leather/install/templates/initializer.rb +3 -1
- data/lib/generators/bootstrap_leather/utils.rb +13 -4
- data/lib/templates/erb/scaffold/_form.html.erb +11 -0
- data/lib/templates/erb/scaffold/edit.html.erb +9 -0
- data/lib/templates/erb/scaffold/index.html.erb +29 -0
- data/lib/templates/erb/scaffold/new.html.erb +7 -0
- data/lib/templates/erb/scaffold/show.html.erb +12 -0
- data/lib/templates/haml/scaffold/_form.html.haml +10 -0
- data/lib/templates/haml/scaffold/edit.html.haml +8 -0
- data/lib/templates/haml/scaffold/index.html.haml +21 -0
- data/lib/templates/haml/scaffold/new.html.haml +6 -0
- data/lib/templates/haml/scaffold/show.html.haml +10 -0
- data/spec/dummy/Rakefile +9 -0
- data/spec/dummy/app/assets/images/.keep +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +16 -0
- data/spec/dummy/app/assets/stylesheets/application.scss +19 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap-everything.scss +54 -0
- data/spec/dummy/app/controllers/application_controller.rb +6 -0
- data/spec/dummy/app/controllers/concerns/.keep +0 -0
- data/spec/dummy/app/controllers/doo_dads_controller.rb +58 -0
- data/spec/dummy/app/controllers/erbits_controller.rb +58 -0
- data/spec/dummy/app/controllers/whatzits_controller.rb +58 -0
- data/spec/dummy/app/helpers/application_helper.rb +4 -0
- data/spec/dummy/app/mailers/application_mailer.rb +6 -0
- data/spec/dummy/app/models/application_record.rb +5 -0
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/app/models/doo_dad.rb +3 -0
- data/spec/dummy/app/models/erbit.rb +2 -0
- data/spec/dummy/app/models/whatzit.rb +2 -0
- data/spec/dummy/app/views/doo_dads/_form.html.haml +16 -0
- data/spec/dummy/app/views/doo_dads/edit.html.haml +7 -0
- data/spec/dummy/app/views/doo_dads/index.html.haml +23 -0
- data/spec/dummy/app/views/doo_dads/new.html.haml +5 -0
- data/spec/dummy/app/views/doo_dads/show.html.haml +12 -0
- data/spec/dummy/app/views/erbits/_form.html.erb +5 -0
- data/spec/dummy/app/views/erbits/edit.html.erb +9 -0
- data/spec/dummy/app/views/erbits/index.html.erb +27 -0
- data/spec/dummy/app/views/erbits/new.html.erb +7 -0
- data/spec/dummy/app/views/erbits/show.html.erb +12 -0
- data/spec/dummy/app/views/layouts/application.html.haml +22 -0
- data/spec/dummy/app/views/pages/index.html.haml +1 -0
- data/spec/dummy/app/views/pages/style_guide.html.haml +801 -0
- data/spec/dummy/app/views/whatzits/_form.html.haml +4 -0
- data/spec/dummy/app/views/whatzits/edit.html.haml +8 -0
- data/spec/dummy/app/views/whatzits/index.html.haml +19 -0
- data/spec/dummy/app/views/whatzits/new.html.haml +6 -0
- data/spec/dummy/app/views/whatzits/show.html.haml +10 -0
- data/spec/dummy/bin/bundle +5 -0
- data/spec/dummy/bin/rails +6 -0
- data/spec/dummy/bin/rake +6 -0
- data/spec/dummy/bin/setup +36 -0
- data/spec/dummy/bin/update +31 -0
- data/spec/dummy/config/application.rb +36 -0
- data/spec/dummy/config/boot.rb +7 -0
- data/spec/dummy/config/cable.yml +9 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +7 -0
- data/spec/dummy/config/environments/development.rb +57 -0
- data/spec/dummy/config/environments/test.rb +45 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +7 -0
- data/spec/dummy/config/initializers/assets.rb +14 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +10 -0
- data/spec/dummy/config/initializers/bootstrap_leather.rb +9 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +7 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +6 -0
- data/spec/dummy/config/initializers/high_voltage.rb +5 -0
- data/spec/dummy/config/initializers/inflections.rb +17 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/new_framework_defaults.rb +29 -0
- data/spec/dummy/config/initializers/session_store.rb +5 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +17 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/puma.rb +49 -0
- data/spec/dummy/config/routes.rb +8 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/config/spring.rb +8 -0
- data/spec/dummy/config.ru +7 -0
- data/spec/dummy/db/migrate/20170407151055_create_doo_dads.rb +10 -0
- data/spec/dummy/db/migrate/20170408145839_create_whatzits.rb +10 -0
- data/spec/dummy/db/migrate/20170408161201_create_erbits.rb +10 -0
- data/spec/dummy/db/schema.rb +36 -0
- data/spec/dummy/db/seeds.rb +7 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/factories/doo_dad.rb +6 -0
- data/spec/factories/erbit.rb +6 -0
- data/spec/factories/whatzit.rb +6 -0
- data/spec/helpers/bootstrap_leather/alerts_helper_spec.rb +62 -0
- data/spec/helpers/bootstrap_leather/badges_helper_spec.rb +41 -0
- data/spec/helpers/bootstrap_leather/carousels_helper_spec.rb +44 -0
- data/spec/helpers/bootstrap_leather/foot_helper_spec.rb +20 -0
- data/spec/helpers/bootstrap_leather/grid_helper_spec.rb +10 -0
- data/spec/helpers/bootstrap_leather/head_helper_spec.rb +82 -0
- data/spec/helpers/bootstrap_leather/hero_unit_helper_spec.rb +20 -0
- data/spec/helpers/bootstrap_leather/icon_helper_spec.rb +48 -0
- data/spec/helpers/bootstrap_leather/modals_helper_spec.rb +22 -0
- data/spec/helpers/bootstrap_leather/navigation_helper_spec.rb +110 -0
- data/spec/helpers/bootstrap_leather/tabs_helper_spec.rb +39 -0
- data/spec/helpers/bootstrap_leather/thumbnails_helper_spec.rb +20 -0
- data/spec/helpers/bootstrap_leather/typography_helper_spec.rb +43 -0
- data/spec/helpers/bootstrap_leather/widgets_helper_spec.rb +22 -0
- data/spec/rails_helper.rb +88 -0
- data/spec/spec_helper.rb +102 -0
- metadata +360 -44
- data/.document +0 -5
- data/README.rdoc +0 -194
- data/app/helpers/bootstrap_leather_helper.rb +0 -232
- data/app/views/bootstrap_leather/_badge_to.html.haml +0 -4
- data/app/views/bootstrap_leather/_dropdown_nav_item.html.haml +0 -11
- data/app/views/bootstrap_leather/_navbar.html.haml +0 -39
- data/app/views/bootstrap_leather/_tabs.html.haml +0 -10
- data/app/views/bootstrap_leather/_widgets.html.haml +0 -9
- data/lib/bootstrap_leather/railtie.rb +0 -9
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# This file is auto-generated from the current state of the database. Instead
|
|
2
|
+
# of editing this file, please use the migrations feature of Active Record to
|
|
3
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
|
4
|
+
#
|
|
5
|
+
# Note that this schema.rb definition is the authoritative source for your
|
|
6
|
+
# database schema. If you need to create the application database on another
|
|
7
|
+
# system, you should be using db:schema:load, not running all the migrations
|
|
8
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
|
9
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
|
10
|
+
#
|
|
11
|
+
# It's strongly recommended that you check this file into your version control system.
|
|
12
|
+
|
|
13
|
+
ActiveRecord::Schema.define(version: 20170408161201) do
|
|
14
|
+
|
|
15
|
+
create_table "doo_dads", force: :cascade do |t|
|
|
16
|
+
t.string "name"
|
|
17
|
+
t.text "body"
|
|
18
|
+
t.datetime "created_at", null: false
|
|
19
|
+
t.datetime "updated_at", null: false
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
create_table "erbits", force: :cascade do |t|
|
|
23
|
+
t.string "name"
|
|
24
|
+
t.text "description"
|
|
25
|
+
t.datetime "created_at", null: false
|
|
26
|
+
t.datetime "updated_at", null: false
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
create_table "whatzits", force: :cascade do |t|
|
|
30
|
+
t.string "name"
|
|
31
|
+
t.text "description"
|
|
32
|
+
t.datetime "created_at", null: false
|
|
33
|
+
t.datetime "updated_at", null: false
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
end
|
|
Binary file
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
module BootstrapLeather
|
|
4
|
+
RSpec.describe AlertsHelper, folder: :helpers do
|
|
5
|
+
describe '#flash_class' do
|
|
6
|
+
describe 'with :notice' do
|
|
7
|
+
subject { helper.flash_class(:notice) }
|
|
8
|
+
it { should eq 'info' }
|
|
9
|
+
end
|
|
10
|
+
describe 'with :error' do
|
|
11
|
+
subject { helper.flash_class(:error) }
|
|
12
|
+
it { should eq 'danger' }
|
|
13
|
+
end
|
|
14
|
+
describe 'with :alert' do
|
|
15
|
+
subject { helper.flash_class(:alert) }
|
|
16
|
+
it { should eq 'warning' }
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
describe '#alert' do
|
|
21
|
+
subject { helper.alert 'danger', 'This is the title', 'This is the text' }
|
|
22
|
+
it do
|
|
23
|
+
should have_tag('div', with: { class: 'alert-danger' })
|
|
24
|
+
end
|
|
25
|
+
it do
|
|
26
|
+
should have_tag('h4', with: {
|
|
27
|
+
class: 'alert-heading'
|
|
28
|
+
}, text: /This is the title/)
|
|
29
|
+
end
|
|
30
|
+
it do
|
|
31
|
+
should have_tag('p', text: /This is the text/)
|
|
32
|
+
end
|
|
33
|
+
it do
|
|
34
|
+
should have_tag('button', with: { class: 'close' })
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
describe '#alert_flash_messages' do
|
|
39
|
+
before do
|
|
40
|
+
[:notice, :error, :alert].each do |level|
|
|
41
|
+
@request.flash[level] = "This is the #{level}"
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
subject { helper.alert_flash_messages }
|
|
45
|
+
it do
|
|
46
|
+
should have_tag 'div', with: {
|
|
47
|
+
class: 'alert-danger'
|
|
48
|
+
}, text: /This is the error/
|
|
49
|
+
end
|
|
50
|
+
it do
|
|
51
|
+
should have_tag 'div', with: {
|
|
52
|
+
class: 'alert-info'
|
|
53
|
+
}, text: /This is the notice/
|
|
54
|
+
end
|
|
55
|
+
it do
|
|
56
|
+
should have_tag 'div', with: {
|
|
57
|
+
class: 'alert-warning'
|
|
58
|
+
}, text: /This is the alert/
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
module BootstrapLeather
|
|
4
|
+
RSpec.describe BadgesHelper, folder: :helpers do
|
|
5
|
+
describe '#badge' do
|
|
6
|
+
describe 'with nil' do
|
|
7
|
+
subject { helper.badge nil }
|
|
8
|
+
it { should eq '' }
|
|
9
|
+
end
|
|
10
|
+
describe 'with a number' do
|
|
11
|
+
subject { helper.badge 1 }
|
|
12
|
+
it { should have_tag 'span', with: { class: 'badge' }, text: /1/ }
|
|
13
|
+
end
|
|
14
|
+
describe 'with a string' do
|
|
15
|
+
subject { helper.badge '1' }
|
|
16
|
+
it { should have_tag 'span', with: { class: 'badge' }, text: /1/ }
|
|
17
|
+
end
|
|
18
|
+
describe 'with a type' do
|
|
19
|
+
subject { helper.badge '1', 'success' }
|
|
20
|
+
it do
|
|
21
|
+
should have_tag 'span', with: { class: 'badge-success' }, text: /1/
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
describe '#badge_to' do
|
|
27
|
+
subject do
|
|
28
|
+
helper.badge_to 'Link Text', 99, 'http://example.com', class: 'example'
|
|
29
|
+
end
|
|
30
|
+
it do
|
|
31
|
+
should have_tag(
|
|
32
|
+
'a',
|
|
33
|
+
class: 'example',
|
|
34
|
+
href: 'http://example.com',
|
|
35
|
+
text: /Link Text/
|
|
36
|
+
)
|
|
37
|
+
end
|
|
38
|
+
it { should have_tag 'span', with: { class: 'badge' }, text: /99/ }
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
module BootstrapLeather
|
|
4
|
+
RSpec.describe CarouselsHelper, folder: :helpers do
|
|
5
|
+
helper IconsHelper
|
|
6
|
+
helper HeadHelper
|
|
7
|
+
helper FootHelper
|
|
8
|
+
|
|
9
|
+
describe '#carousel' do
|
|
10
|
+
subject do
|
|
11
|
+
helper.carousel 'css-id', DooDad.all do |item|
|
|
12
|
+
%(
|
|
13
|
+
<div class='carousel-caption'><h4>#{item.name}</h4></div>
|
|
14
|
+
<p>#{item.body}</p>
|
|
15
|
+
).html_safe
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
it do
|
|
19
|
+
should have_tag 'div', with: {
|
|
20
|
+
class: 'carousel', id: 'css-id'
|
|
21
|
+
}
|
|
22
|
+
end
|
|
23
|
+
it { should have_tag 'div', with: { class: 'item' }, count: 5}
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
describe '#carousel_with_thumbnails' do
|
|
27
|
+
subject do
|
|
28
|
+
helper.carousel_with_thumbnails 'css-id', DooDad.all do |item|
|
|
29
|
+
%(
|
|
30
|
+
<div class='carousel-caption'><h4>#{item.name}</h4></div>
|
|
31
|
+
<p>#{item.body}</p>
|
|
32
|
+
#{image_tag 'src.png', data: { thumbnail: 'thumb.png' }}
|
|
33
|
+
).html_safe
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
it do
|
|
37
|
+
should have_tag 'div', with: {
|
|
38
|
+
class: 'carousel-with-thumbnails', id: 'css-id'
|
|
39
|
+
}
|
|
40
|
+
end
|
|
41
|
+
it { should have_tag 'div', with: { class: 'item' }, count: 5}
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
module BootstrapLeather
|
|
4
|
+
RSpec.describe FootHelper, folder: :helpers do
|
|
5
|
+
describe '#add_footer_javascript' do
|
|
6
|
+
before do
|
|
7
|
+
helper.add_footer_javascript { 'foo' }
|
|
8
|
+
end
|
|
9
|
+
subject { helper.content_for(:footer_javascript) }
|
|
10
|
+
it { should eq 'foo' }
|
|
11
|
+
end
|
|
12
|
+
describe '#render_footer_javascript' do
|
|
13
|
+
before do
|
|
14
|
+
helper.content_for(:footer_javascript) { 'bar' }
|
|
15
|
+
end
|
|
16
|
+
subject { helper.render_footer_javascript }
|
|
17
|
+
it { should match /bar/ }
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
module BootstrapLeather
|
|
4
|
+
RSpec.describe HeadHelper, folder: :helpers do
|
|
5
|
+
describe '#responsive_meta_tag' do
|
|
6
|
+
subject { helper.responsive_meta_tag }
|
|
7
|
+
it { should have_tag 'meta', with: { name: 'viewport' } }
|
|
8
|
+
end
|
|
9
|
+
describe '#add_title' do
|
|
10
|
+
before do
|
|
11
|
+
helper.add_title 'Title'
|
|
12
|
+
end
|
|
13
|
+
subject { helper.content_for(:title) }
|
|
14
|
+
it { should eq 'Title' }
|
|
15
|
+
end
|
|
16
|
+
describe '#add_subtitle' do
|
|
17
|
+
before do
|
|
18
|
+
helper.add_subtitle 'Subtitle'
|
|
19
|
+
end
|
|
20
|
+
subject { helper.content_for(:subtitle) }
|
|
21
|
+
it { should eq 'Subtitle' }
|
|
22
|
+
end
|
|
23
|
+
describe '#render_title' do
|
|
24
|
+
before do
|
|
25
|
+
helper.content_for(:title) { 'Title' }
|
|
26
|
+
helper.content_for(:subtitle) { 'Subtitle' }
|
|
27
|
+
end
|
|
28
|
+
subject { helper.render_title }
|
|
29
|
+
it { should have_tag 'title', text: 'Title: Subtitle: Dummy Site' }
|
|
30
|
+
end
|
|
31
|
+
describe '#add_description' do
|
|
32
|
+
before do
|
|
33
|
+
helper.add_description 'Description'
|
|
34
|
+
end
|
|
35
|
+
subject { helper.content_for(:description) }
|
|
36
|
+
it { should eq 'Description' }
|
|
37
|
+
end
|
|
38
|
+
describe '#render_description' do
|
|
39
|
+
before do
|
|
40
|
+
helper.content_for(:description) { 'Description' }
|
|
41
|
+
end
|
|
42
|
+
subject { helper.render_description }
|
|
43
|
+
it do
|
|
44
|
+
should have_tag 'meta', with: {
|
|
45
|
+
name: 'description', content: 'Description'
|
|
46
|
+
}
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
describe '#add_keywords' do
|
|
50
|
+
before do
|
|
51
|
+
helper.add_keywords 'Keywords'
|
|
52
|
+
end
|
|
53
|
+
subject { helper.content_for(:keywords) }
|
|
54
|
+
it { should eq 'Keywords' }
|
|
55
|
+
end
|
|
56
|
+
describe '#render_keywords' do
|
|
57
|
+
before do
|
|
58
|
+
helper.content_for(:keywords) { 'Keywords' }
|
|
59
|
+
end
|
|
60
|
+
subject { helper.render_keywords }
|
|
61
|
+
it do
|
|
62
|
+
should have_tag 'meta', with: {
|
|
63
|
+
name: 'keywords', content: 'Keywords'
|
|
64
|
+
}
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
describe '#add_head_css' do
|
|
68
|
+
before do
|
|
69
|
+
helper.add_head_css { 'foo' }
|
|
70
|
+
end
|
|
71
|
+
subject { helper.content_for(:head_css) }
|
|
72
|
+
it { should eq 'foo' }
|
|
73
|
+
end
|
|
74
|
+
describe '#render_head_css' do
|
|
75
|
+
before do
|
|
76
|
+
helper.content_for(:head_css) { 'bar' }
|
|
77
|
+
end
|
|
78
|
+
subject { helper.render_head_css }
|
|
79
|
+
it { should match /bar/ }
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
module BootstrapLeather
|
|
4
|
+
RSpec.describe HeroUnitHelper, folder: :helpers do
|
|
5
|
+
describe '#add_hero_unit' do
|
|
6
|
+
before do
|
|
7
|
+
helper.add_hero_unit { 'Yay!' }
|
|
8
|
+
end
|
|
9
|
+
subject { helper.content_for(:hero_unit) }
|
|
10
|
+
it { should eq 'Yay!' }
|
|
11
|
+
end
|
|
12
|
+
describe '#render_hero_unit' do
|
|
13
|
+
before do
|
|
14
|
+
helper.content_for(:hero_unit) { 'Yay!' }
|
|
15
|
+
end
|
|
16
|
+
subject { helper.render_hero_unit }
|
|
17
|
+
it { should have_tag 'div', with: { class: 'jumbotron' }, text: /Yay!/ }
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
module BootstrapLeather
|
|
4
|
+
RSpec.describe IconsHelper, folder: :helpers do
|
|
5
|
+
describe '#icon' do
|
|
6
|
+
subject { helper.icon 'check' }
|
|
7
|
+
it { should have_tag 'span', with: { class: 'glyphicon-check' } }
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
describe '#icon_button_to' do
|
|
11
|
+
subject do
|
|
12
|
+
helper.icon_button_to(
|
|
13
|
+
'success',
|
|
14
|
+
'check',
|
|
15
|
+
'Link Text',
|
|
16
|
+
'http://example.com',
|
|
17
|
+
class: 'example'
|
|
18
|
+
)
|
|
19
|
+
end
|
|
20
|
+
it do
|
|
21
|
+
should have_tag(
|
|
22
|
+
:a,
|
|
23
|
+
class: 'example',
|
|
24
|
+
href: 'http://example.com',
|
|
25
|
+
text: /Link Text/
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
it { should have_tag 'span', with: { class: 'glyphicon-check' } }
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
describe '#icon_link_to' do
|
|
32
|
+
subject do
|
|
33
|
+
helper.icon_link_to(
|
|
34
|
+
'check', 'Link Text', 'http://example.com', class: 'example'
|
|
35
|
+
)
|
|
36
|
+
end
|
|
37
|
+
it do
|
|
38
|
+
should have_tag(
|
|
39
|
+
:a,
|
|
40
|
+
class: 'example',
|
|
41
|
+
href: 'http://example.com',
|
|
42
|
+
text: /Link Text/
|
|
43
|
+
)
|
|
44
|
+
end
|
|
45
|
+
it { should have_tag 'span', with: { class: 'glyphicon-check' } }
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
module BootstrapLeather
|
|
4
|
+
RSpec.describe ModalsHelper, folder: :helpers do
|
|
5
|
+
describe '#modal' do
|
|
6
|
+
subject do
|
|
7
|
+
helper.modal 'css-id', 'Title' do
|
|
8
|
+
%(Contents Go Here)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
it { should have_tag 'div', with: { class: 'modal', id: 'css-id' } }
|
|
12
|
+
it { should have_tag 'h3', with: { class: 'modal-title' }, text: 'Title'}
|
|
13
|
+
it do
|
|
14
|
+
should have_tag(
|
|
15
|
+
:div,
|
|
16
|
+
with: { class: 'modal-body' },
|
|
17
|
+
text: /Contents Go Here/
|
|
18
|
+
)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
module BootstrapLeather
|
|
4
|
+
RSpec.describe NavigationHelper, folder: :helpers do
|
|
5
|
+
describe '#nav_item' do
|
|
6
|
+
subject { helper.nav_item 'Link Text', 'http://example.com' }
|
|
7
|
+
it { should have_tag 'li' }
|
|
8
|
+
it do
|
|
9
|
+
should have_tag(
|
|
10
|
+
'a',
|
|
11
|
+
with: { href: 'http://example.com' },
|
|
12
|
+
text: /Link Text/
|
|
13
|
+
)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
describe '#nav_heading' do
|
|
18
|
+
subject { helper.nav_heading 'Heading Text' }
|
|
19
|
+
it do
|
|
20
|
+
should have_tag(
|
|
21
|
+
:li,
|
|
22
|
+
with: { class: 'dropdown-header' },
|
|
23
|
+
text: /Heading Text/
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
describe '#nav_list' do
|
|
29
|
+
subject do
|
|
30
|
+
helper.nav_list do
|
|
31
|
+
%(<li>List Item</li>)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
it do
|
|
35
|
+
should have_tag(
|
|
36
|
+
:ul,
|
|
37
|
+
with: { class: 'nav' },
|
|
38
|
+
text: /List Item/
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
describe '#navbar' do
|
|
44
|
+
subject do
|
|
45
|
+
helper.navbar { 'Contents' }
|
|
46
|
+
end
|
|
47
|
+
it do
|
|
48
|
+
should have_tag 'nav', with: { class: 'navbar' }
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
describe '#navbar_with_container' do
|
|
53
|
+
subject do
|
|
54
|
+
helper.navbar_with_container { 'Contents' }
|
|
55
|
+
end
|
|
56
|
+
it 'puts the container in a navbar' do
|
|
57
|
+
expect(subject).to(
|
|
58
|
+
have_tag('nav', with: { class: 'navbar' }) do
|
|
59
|
+
with_tag 'div', with: { class: 'container' }
|
|
60
|
+
end
|
|
61
|
+
)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
describe '#navbar_in_container' do
|
|
66
|
+
subject do
|
|
67
|
+
helper.navbar_in_container { 'Contents' }
|
|
68
|
+
end
|
|
69
|
+
it 'puts the navbar in a container' do
|
|
70
|
+
expect(subject).to(
|
|
71
|
+
have_tag('div', with: { class: 'container' }) do
|
|
72
|
+
with_tag 'nav', with: { class: 'navbar' }
|
|
73
|
+
end
|
|
74
|
+
)
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
describe '#dropdown_nav_item' do
|
|
79
|
+
subject do
|
|
80
|
+
helper.dropdown_nav_item 'Heading', '#' do
|
|
81
|
+
helper.nav_list do
|
|
82
|
+
helper.nav_item 'Link', 'http://example.com'
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
it 'shows a dropdown item' do
|
|
87
|
+
expect(subject).to(
|
|
88
|
+
have_tag('li', with: { class: 'dropdown' }) do
|
|
89
|
+
with_tag(
|
|
90
|
+
'a',
|
|
91
|
+
with: { class: 'dropdown-toggle', href: '#' },
|
|
92
|
+
text: /Heading/
|
|
93
|
+
)
|
|
94
|
+
with_tag 'ul', with: { class: 'dropdown-menu' } do
|
|
95
|
+
with_tag 'li' do
|
|
96
|
+
with_tag 'a', with: { href: 'http://example.com' }, text: /Link/
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
)
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
describe '#logo_and_title' do
|
|
105
|
+
subject { helper.logo_and_title }
|
|
106
|
+
it { should have_tag 'img', with: { src: '/assets/logo.svg' } }
|
|
107
|
+
it { should match /Dummy Site/ }
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
module BootstrapLeather
|
|
4
|
+
RSpec.describe TabsHelper, folder: :helpers do
|
|
5
|
+
describe '#add_tab and #render_tabs' do
|
|
6
|
+
before do
|
|
7
|
+
helper.add_tab 'Foo', 'foo' do
|
|
8
|
+
Faker::Lorem.paragraph
|
|
9
|
+
end
|
|
10
|
+
helper.add_tab 'Bar', 'bar' do
|
|
11
|
+
Faker::Lorem.paragraph
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
subject { helper.render_tabs }
|
|
15
|
+
it 'shows the tab links' do
|
|
16
|
+
expect(subject).to(
|
|
17
|
+
have_tag('div', with: { class: 'tabs-top' }) do
|
|
18
|
+
with_tag 'ul', with: { class: 'nav-tabs' } do
|
|
19
|
+
with_tag 'li' do
|
|
20
|
+
with_tag 'a', text: /Foo/
|
|
21
|
+
end
|
|
22
|
+
with_tag 'li' do
|
|
23
|
+
with_tag 'a', text: /Bar/
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
it 'shows the tabs' do
|
|
30
|
+
expect(subject).to(
|
|
31
|
+
have_tag('div', with: { class: 'tab-content' }) do
|
|
32
|
+
with_tag 'div', with: { id: 'foo' }
|
|
33
|
+
with_tag 'div', with: { id: 'bar' }
|
|
34
|
+
end
|
|
35
|
+
)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
module BootstrapLeather
|
|
4
|
+
RSpec.describe ThumbnailsHelper, folder: :helpers do
|
|
5
|
+
describe '#thumbnail' do
|
|
6
|
+
subject do
|
|
7
|
+
helper.thumbnail image_tag '/assets/logo.svg'
|
|
8
|
+
end
|
|
9
|
+
it 'shows a thumbnail' do
|
|
10
|
+
expect(subject).to(
|
|
11
|
+
have_tag('ul', with: { class: 'thumbnails' }) do
|
|
12
|
+
with_tag 'li', with: { class: 'thumbnail' } do
|
|
13
|
+
with_tag 'img', with: { src: '/assets/logo.svg' }
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
module BootstrapLeather
|
|
4
|
+
RSpec.describe TypographyHelper, folder: :helpers do
|
|
5
|
+
helper HeadHelper
|
|
6
|
+
|
|
7
|
+
describe '#render_h1' do
|
|
8
|
+
before do
|
|
9
|
+
helper.add_title 'Title'
|
|
10
|
+
end
|
|
11
|
+
it 'shows the title' do
|
|
12
|
+
expect(helper.render_h1).to(have_tag 'h1', text: /Title/)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
describe '#render_page_header' do
|
|
16
|
+
before do
|
|
17
|
+
helper.add_title 'Title'
|
|
18
|
+
helper.add_subtitle 'Subtitle'
|
|
19
|
+
end
|
|
20
|
+
it 'shows the title and subtitle' do
|
|
21
|
+
expect(helper.render_page_header).to(
|
|
22
|
+
have_tag('div', with: { class: 'page-header' }) do
|
|
23
|
+
with_tag 'h1', text: /Title/ do
|
|
24
|
+
with_tag 'small', text: /Subtitle/
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
describe '#dl' do
|
|
31
|
+
it 'shows a dl' do
|
|
32
|
+
expect(helper.dl( { name: 'Name', body: 'Body' } )).to(
|
|
33
|
+
have_tag('dl') do
|
|
34
|
+
with_tag 'dt', text: /name/
|
|
35
|
+
with_tag 'dd', text: /Name/
|
|
36
|
+
with_tag 'dt', text: /body/
|
|
37
|
+
with_tag 'dd', text: /Body/
|
|
38
|
+
end
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
module BootstrapLeather
|
|
4
|
+
RSpec.describe WidgetsHelper, folder: :helpers do
|
|
5
|
+
helper GridHelper
|
|
6
|
+
describe '#add_widget and #render_widgets' do
|
|
7
|
+
before do
|
|
8
|
+
helper.add_widget do
|
|
9
|
+
Faker::Lorem.paragraph
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
subject { helper.render_widgets('md', 3) }
|
|
13
|
+
it 'shows the tab links' do
|
|
14
|
+
expect(subject).to(
|
|
15
|
+
have_tag(:div, with: { class: 'col-md-3' }) do
|
|
16
|
+
with_tag :div, with: { class: 'well' }
|
|
17
|
+
end
|
|
18
|
+
)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|