Guest User

Untitled

a guest
Mar 24th, 2018
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.24 KB | None | 0 0
  1. Rails.env = 'test'
  2.  
  3. development:
  4. adapter: postgresql
  5. encoding: unicode
  6. database: app_dev
  7. pool: 5
  8. username: postgres
  9. password: root
  10.  
  11. test:
  12. adapter: postgresql
  13. encoding: unicode
  14. database: app_test
  15. pool: 5
  16. username: postgres
  17. password: root
  18.  
  19. production:
  20. adapter: postgresql
  21. encoding: unicode
  22. database: app_prod
  23. pool: 5
  24. username: postgres
  25. password: root
  26.  
  27. Rails.env = 'test'
  28. require 'spec_helper'
  29. require File.expand_path('../../config/environment', __FILE__)
  30. require 'rspec/rails'
  31. Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
  32.  
  33. ActiveRecord::Migration.maintain_test_schema!
  34.  
  35. RSpec.configure do |config|
  36. config.include JsonHelper
  37. config.include PathHelper
  38. config.include S3Helper
  39. config.fixture_path = "#{::Rails.root}/spec/fixtures"
  40. config.use_transactional_fixtures = true
  41. config.infer_spec_type_from_file_location!
  42. end
  43.  
  44. require File.expand_path('../boot', __FILE__)
  45.  
  46. require 'rails/all'
  47. require 'yaml'
  48. # Require the gems listed in Gemfile, including any gems
  49. # you've limited to :test, :development, or :production.
  50. Bundler.require(*Rails.groups)
  51.  
  52. module AppName
  53. class Application < Rails::Application
  54. config.generators do |g|
  55. g.assets = false
  56. g.helper = false
  57. g.views = false
  58. end
  59.  
  60. # Load all locale files
  61. config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]
  62. config.i18n.load_path += Dir[Rails.root.join(
  63. 'config', 'locales', '**', '**', '*.{rb,yml}')]
  64. config.autoload_paths += %W(#{config.root}/lib)
  65. config.autoload_paths += Dir["#{config.root}/lib/**/"]
  66. config.autoload_paths += Dir["#{config.root}/app/workers/"]
  67. config.action_controller.include_all_helpers = false
  68. config.active_record.schema_format = :sql
  69. config.i18n.available_locales = [:en, :hi, :mr]
  70. config.i18n.default_locale = :hi
  71. config.i18n.fallbacks = [:en]
  72. config.active_record.raise_in_transactional_callbacks = true
  73. end
  74. end
  75.  
  76. source 'https://rubygems.org'
  77.  
  78. # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
  79. gem 'rails', '4.2.0'
  80.  
  81. # Use postgresql as the database for Active Record
  82. gem 'pg', '~> 0.18.2'
  83.  
  84. # Use SCSS for stylesheets
  85. gem 'sass-rails', '~> 5.0'
  86.  
  87. # Use Uglifier as compressor for JavaScript assets
  88. gem 'uglifier', '>= 1.3.0'
  89.  
  90. # Use CoffeeScript for .coffee assets and views
  91. gem 'coffee-rails', '~> 4.1.0'
  92. # Turbolinks makes following links in your web application faster
  93. gem 'turbolinks', '~> 2.5.3'
  94.  
  95. # Use Unicorn as the app server
  96. gem 'unicorn', '~> 4.9.0'
  97.  
  98. # Use jquery as the JavaScript library
  99. gem 'jquery-rails', '~> 4.0.4'
  100.  
  101. # Integrate the jQuery Validation plugin into the Rails asset pipeline
  102. gem 'jquery-validation-rails', '~> 1.13.1'
  103.  
  104. # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
  105. gem 'jbuilder', '~> 2.0'
  106.  
  107. # bundle exec rake doc:rails generates the API under doc/api.
  108. gem 'sdoc', '~> 0.4.0', group: :doc
  109.  
  110. # use swagger for api documentation
  111. gem 'swagger-docs', '~> 0.1.9'
  112.  
  113. # for consuming restful web services
  114. gem 'httparty', '~> 0.13.5'
  115.  
  116. # for ActiveRecord model/data translations
  117. gem 'globalize', '~> 5.0.0'
  118.  
  119. # generates accessors for translated fields
  120. gem 'globalize-accessors', '~>0.2.1'
  121.  
  122. # Amazon Web service SDK Ruby
  123. gem 'aws-sdk', '~> 2.1.0'
  124.  
  125. # cloud services for S3
  126. gem 'fog', '~> 1.33.0'
  127.  
  128. # handle file uploads
  129. gem 'carrierwave', '~>0.10.0'
  130.  
  131. # Photo Resizing
  132. gem 'mini_magick', '~> 4.2.7'
  133.  
  134. # Background Jobs
  135. gem 'sidekiq', '~> 3.4.2'
  136.  
  137. # Geocoder
  138. gem 'geocoder', '~> 1.2.9'
  139.  
  140. # active admin
  141. gem 'activeadmin', '~> 1.0.0.pre1'
  142.  
  143. # for authentication
  144. gem 'devise', '~> 3.5.1'
  145.  
  146. # for roles of active admin
  147. gem 'rolify', '~> 4.0.0'
  148.  
  149. # for authorization
  150. gem 'cancan', '~> 1.6.10'
  151.  
  152. group :development, :test do
  153. # Debugging using pry
  154. gem 'pry-rails', '~> 0.3.4'
  155. gem 'pry-byebug', '~> 3.1.0'
  156.  
  157. # testing framework for rails
  158. gem 'rspec-rails', '~> 3.1.0'
  159. gem 'rspec-collection_matchers', '~> 1.1.2'
  160. gem 'factory_girl_rails', '~> 4.4.1'
  161. gem 'shoulda-matchers', '~> 2.8.0'
  162.  
  163. # code test coverage
  164. gem 'simplecov', '~> 0.7.1'
  165. gem 'simplecov-rcov', '~> 0.2.3'
  166. # Access an IRB console on exception pages or by using <%= console %> in views
  167. gem 'web-console', '~> 2.0'
  168.  
  169. # speeds up development by keeping your application running in the background
  170. gem 'spring', '~> 1.3.6'
  171. end
  172.  
  173. group :development do
  174. # generates ER diagrams for rails application
  175. gem 'rails-erd', '~> 1.4.1'
  176. end
  177.  
  178. group :test do
  179. # set of strategies for cleaning your database
  180. gem 'database_cleaner', '~> 1.3.0'
  181. end
  182.  
  183. Rails.env
  184. #=> "test"
  185.  
  186. ActiveRecord::Base.connection_config
  187. #=> {:adapter=>"postgresql", :encoding=>"unicode", :database=>"app_dev", :pool=>5, :username=>"postgres", :password=>"root"}
  188.  
  189. require File.expand_path('../../config/environment', __FILE__)
  190. require 'rspec/rails'
  191. require 'simplecov'
  192. require 'simplecov-rcov'
  193. require 'database_cleaner'
  194. require 'factory_girl_rails'
  195.  
  196. ENV['RAILS_ENV'] ||= 'test'
  197. SimpleCov.start
  198.  
  199. RSpec.configure do |config|
  200. config.include FactoryGirl::Syntax::Methods
  201. # Database Cleaner
  202. config.before(:suite) do
  203. DatabaseCleaner.strategy = :transaction
  204. DatabaseCleaner.clean_with(:truncation)
  205. Rails.application.load_seed
  206. end
  207.  
  208. config.before(:each) do
  209. DatabaseCleaner.start
  210. end
  211.  
  212. config.after(:each) do
  213. DatabaseCleaner.clean
  214. end
  215.  
  216. config.expect_with :rspec do |expectations|
  217. expectations.include_chain_clauses_in_custom_matcher_descriptions = true
  218. end
  219.  
  220. config.mock_with :rspec do |mocks|
  221. mocks.verify_partial_doubles = true
  222. end
  223. end
  224.  
  225. SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
  226.  
  227. ActiveRecord::Base.establish_connection
  228.  
  229. Rails.env = 'test'
  230.  
  231. require File.expand_path('../../config/environment', __FILE__)
  232. Rails.env = 'test'
  233. require 'spec_helper'
  234. require 'rspec/rails'
  235. Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
  236.  
  237. # the rest
  238.  
  239. expect(ActiveRecord::Base.connection_config[:database]).to match(/test/)
  240.  
  241. gem 'rails-erd', '~> 1.4.1', require: false
  242.  
  243. spring stop
  244.  
  245. rspec
  246.  
  247. Rails.env = 'test'
  248.  
  249. group :test do
  250. # testing framework for rails
  251. gem 'rspec-rails', '~> 3.1.0'
  252. gem 'rspec-collection_matchers', '~> 1.1.2'
  253. gem 'factory_girl_rails', '~> 4.4.1'
  254. gem 'shoulda-matchers', '~> 2.8.0'
  255.  
  256. # set of strategies for cleaning your database
  257. gem 'database_cleaner', '~> 1.3.0'
  258. end
Add Comment
Please, Sign In to add comment