Commit bbded518

mo khan <mo@mokhan.ca>
2015-02-02 05:41:13
hound happy.
1 parent a035ea6
Changed files (3)
config/application.rb
@@ -1,4 +1,4 @@
-require File.expand_path('../boot', __FILE__)
+require File.expand_path("../boot", __FILE__)
 
 # Pick the frameworks you want:
 require "active_model/railtie"
@@ -11,7 +11,7 @@ require "sprockets/railtie"
 # require "rails/test_unit/railtie"
 
 # Require the gems listed in Gemfile, including any gems
-# you've limited to :test, :development, or :production.
+# you"ve limited to :test, :development, or :production.
 Bundler.require(*Rails.groups)
 
 module Cake
@@ -28,11 +28,12 @@ module Cake
 
     # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
     # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
-    # config.time_zone = 'Central Time (US & Canada)'
+    # config.time_zone = "Central Time (US & Canada)"
 
     # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
-    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
-    config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]
+    # config.i18n.load_path += Dir[Rails.root.join("my", "locales", "*.{rb,yml}").to_s]
+    translations_path = Rails.root.join("config", "locales", "**", "*.{rb,yml}")
+    config.i18n.load_path += Dir[translations_path]
     # config.i18n.default_locale = :de
 
     # Do not swallow errors in after_commit/after_rollback callbacks.
@@ -47,9 +48,9 @@ module Cake
       end
     end
     config.middleware.use ExceptionNotification::Rack, :email => {
-      :email_prefix => "[Boom! #{Rails.env}] ",
-      :sender_address => %{"notifier" <notifier@cakeside.com>},
-      :exception_recipients => ENV['EXCEPTION_EMAIL_ADDRESS'].try(:split, " "),
+      email_prefix: "[Boom! #{Rails.env}] ",
+      sender_address: %{"notifier" <notifier@cakeside.com>},
+      exception_recipients: ENV["EXCEPTION_EMAIL_ADDRESS"].try(:split, " "),
     } unless Rails.env.test?
     config.middleware.use Rack::Attack
   end
spec/controllers/my/passwords_controller_spec.rb
@@ -25,7 +25,8 @@ describe My::PasswordsController do
         end
 
         it "displays an error on the page" do
-          expect(flash[:error]).to eql(I18n.t("my.passwords.passwords_do_not_match"))
+          error_message = I18n.t("my.passwords.passwords_do_not_match")
+          expect(flash[:error]).to eql(error_message)
         end
 
         it "renders the show template" do
spec/features/change_password_spec.rb
@@ -2,20 +2,20 @@ require "rails_helper"
 
 describe "changing my password", js: true do
   context "when changing my password" do
-    let(:user) { create(:user, :password => "password") }
+    let(:user) { create(:user, password: "password") }
 
     before :each do
       visit login_path
       within(".form-inline") do
-        fill_in("session_username", :with => user.email)
-        fill_in("session_password", :with => "password")
+        fill_in("session_username", with: user.email)
+        fill_in("session_password", with: "password")
       end
       click_button("Sign In")
       visit my_dashboard_path
       click_link("Account")
       within(".form-horizontal") do
-        fill_in("user_password", :with => "mopass")
-        fill_in("user_password_confirmation", :with => "mopass")
+        fill_in("user_password", with: "mopass")
+        fill_in("user_password_confirmation", with: "mopass")
       end
       click_button "Update password"
     end