Advertisement
Guest User

Untitled

a guest
Aug 13th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. # Rails 4.2 -> 5.0 アップグレード
  2. ## gem update
  3.  
  4. Gemfile
  5.  
  6. gem 'rails', '5.0.0.1'
  7.  
  8. > $ bundle update
  9.  
  10.  
  11. ## config アップデート
  12.  
  13. > $ bundle exec rails app:update
  14.  
  15. - ファイル追加
  16.  
  17. config/initializers/locale.rb
  18.  
  19. # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
  20. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
  21. # config.i18n.default_locale = :de
  22. Rails.application.config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '*.{rb,yml}').to_s]
  23. Rails.application.config.i18n.default_locale = :ja
  24.  
  25. config/initializers/slim_engine.rb
  26.  
  27. # Indent html for pretty debugging
  28. Slim::Engine.set_options pretty: true
  29.  
  30. ## spec
  31. ### spec support
  32. spec/support/request_macros.rb
  33.  
  34. module RequestMacros
  35. def request_login_user
  36. before(:each) do
  37. @loginuser = FactoryGirl.create(:login_user)
  38. post user_session_path, params: { user: {email: @loginuser.email, password: @loginuser.password } }
  39. follow_redirect!
  40. end
  41. end
  42.  
  43. def request_admin_user
  44. before(:each) do
  45. @loginuser = FactoryGirl.create(:login_user)
  46. post user_session_path, params: { user: {email: @loginuser.email, password: @loginuser.password } }
  47. follow_redirect!
  48. end
  49. end
  50. end
  51.  
  52. ### controller spec
  53. Gemfile
  54.  
  55. gem 'rails-controller-testing'
  56.  
  57. spec/controllers
  58.  
  59. # get :show, params: { id: 1 }, session: { user_id: 1 }
  60. process :update, method: :post, params: { id: 1 }
  61.  
  62. ## db migrate
  63.  
  64. > $ bundle exec rails db:migrate
  65.  
  66. migrate files
  67.  
  68. class DeviseCreateUsers < ActiveRecord::Migration[5.0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement