<% end %>
diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb
index 4b8786f02..d86db2045 100644
--- a/config/initializers/simple_form.rb
+++ b/config/initializers/simple_form.rb
@@ -66,7 +66,7 @@
config.error_notification_tag = :div
# CSS class to add for error notification helper.
- config.error_notification_class = 'alert alert-error'
+ config.error_notification_class = 'alert alert-danger'
# ID to add for error notification helper.
# config.error_notification_id = nil
diff --git a/spec/helpers/.gitkeep b/spec/helpers/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb
new file mode 100644
index 000000000..dee9814e5
--- /dev/null
+++ b/spec/helpers/application_helper_spec.rb
@@ -0,0 +1,29 @@
+require 'spec_helper'
+
+RSpec.describe ApplicationHelper do
+ it 'avatar_url returns url to gravatar' do
+ user = Fabricate(:user)
+ gravatar_id = Digest::MD5::hexdigest(user.email).downcase
+ expect(helper.avatar_url(user, 50)).to eq("https://www.gravatar.com/avatar/#{gravatar_id}.png?d=identicon&gravatar=hashed&set=set1&size=50x50")
+ end
+
+ describe 'seconds_to_hm' do
+ it 'with 0 returns em dash' do
+ expect(helper.seconds_to_hm(0)).to eq("—")
+ end
+
+ it 'with non-zero returns specific format' do
+ expect(helper.seconds_to_hm(10)).to eq("0:00")
+ expect(helper.seconds_to_hm(60)).to eq("0:01")
+ expect(helper.seconds_to_hm(-60)).to eq("-0:01")
+ expect(helper.seconds_to_hm(3600)).to eq("1:00")
+ end
+ end
+
+ it 'alert_class returns specific error classes' do
+ expect(helper.alert_class('error')).to eq('alert-danger')
+ expect(helper.alert_class('alert')).to eq('alert-danger')
+ expect(helper.alert_class('notice')).to eq('alert-success')
+ expect(helper.alert_class('foo')).to eq('alert-info')
+ end
+end
\ No newline at end of file
diff --git a/spec/helpers/glyph_helper_spec.rb b/spec/helpers/glyph_helper_spec.rb
new file mode 100644
index 000000000..9c3578395
--- /dev/null
+++ b/spec/helpers/glyph_helper_spec.rb
@@ -0,0 +1,14 @@
+require 'spec_helper'
+
+RSpec.describe GlyphHelper do
+ describe 'glyph helper' do
+ it 'renders an span with glyphicon classes' do
+ expect(helper.glyph('foo')).to match(/<\/span>/)
+ end
+
+ it 'special mappings' do
+ sample = GlyphHelper::GLYPHS.to_a.sample[0]
+ expect(helper.glyph(sample)).to match(GlyphHelper::GLYPHS[sample])
+ end
+ end
+end
\ No newline at end of file
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 8bb3db7cd..b33a21212 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,6 +1,6 @@
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
-ENV["ADMINS"] = "superadmin@example.com"
+ENV["ADMINS"] = "admin@timeoverflow.org"
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
@@ -11,6 +11,7 @@
require 'selenium/webdriver'
require 'faker'
require 'shoulda/matchers'
+
I18n.reload!
Capybara.register_driver :chrome do |app|
@@ -36,7 +37,7 @@
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
-# Make sure schem persists when running tests.
+# Make sure schema persists when running tests.
# We ran into an error that forced us to run rake db:migrate RAILS_ENV=test
# before running tests. This kind of fixes it, although we should have a closer
# look at this and find a better solution
@@ -75,7 +76,6 @@
feature_specs = items_by_type[:feature] || []
rest_of_specs = items_by_type[:rest] || []
-
random = Random.new(config.seed)
[