startblock 1.4 → 1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d4cbd0cf6a715971b53dbfcce768380b9a8d4123
4
- data.tar.gz: a0447a54c7c475e68a8088b549f25a1e3018e8f2
3
+ metadata.gz: 6664a02a0ccc220b3dcca7770939c7d45d1e6f47
4
+ data.tar.gz: 7c39990b64271627b0d32a9399f6f5fb3d35309b
5
5
  SHA512:
6
- metadata.gz: 393010437012ddcc932f26bfd3807ee32234857d0431daba0fc844dcbdffc504d65f844c45e13c36ce1ba30164c78fccafc8ab9b974911b06a48ffde9a3118c0
7
- data.tar.gz: 350e810d96d0727d7d4c9cee0b2d664501a9f13ea818206ce72f5212339847731b9e24374acd459854a1df333358cd321ff8b58454444b0ae78b124102eb11b5
6
+ metadata.gz: 72b585703b231102b10ef08edc6bf571a74434c95b68eb50031fc9253b8b53c7b1bae6e52d49a512222c675f10c39a463618ceb5c714dec7ede1184937c45dda
7
+ data.tar.gz: 3f1e4022007cd537d33efca15727600d0a7b33b83895c371961bfb3885a8942588478c138ce783ef8cf3d448fa99a56bf04a51fad46161c1fdf432e9a3faa1ed
data/CHANGELOG CHANGED
@@ -2,12 +2,16 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
- ## V1.5 - Unreleased
5
+ ## V1.5 - Olive Nickel - 2016-02-19
6
6
 
7
7
  ### Changed
8
+ - Disable asset and helper generation in `rails generate` command
9
+
8
10
  ### Added
11
+ - Add our test_helper.rb
12
+
9
13
  ### Removed
10
- ### Fixed
14
+ - Raise on missing I18n
11
15
 
12
16
  ## V1.4 - Maroon Lead - 2016-01-29
13
17
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- V1.4
1
+ V1.5
@@ -37,17 +37,22 @@ module Startblock
37
37
  inject_into_class "config/application.rb", "Application", config
38
38
  end
39
39
 
40
+ def disable_helper_generation
41
+ config = <<-RUBY
42
+ config.generators.stylesheets = false
43
+ config.generators.javascripts = false
44
+ config.generators.helper = false
45
+ RUBY
46
+
47
+ inject_into_class "config/application.rb", "Application", config
48
+ end
49
+
40
50
  def provide_setup_script
41
51
  remove_file "bin/setup"
42
52
  template "bin_setup.erb", "bin/setup"
43
53
  run "chmod a+x bin/setup"
44
54
  end
45
55
 
46
- def configure_i18n_for_missing_translations
47
- raise_on_missing_translations_in("development")
48
- raise_on_missing_translations_in("test")
49
- end
50
-
51
56
  def configuring_test_helper
52
57
  remove_file "test/test_helper.rb"
53
58
  template "test_helper.erb", "test/test_helper.rb"
@@ -138,13 +143,5 @@ end
138
143
  def setup_rubocop
139
144
  copy_file "rubocop.yml", ".rubocop.yml"
140
145
  end
141
-
142
- private
143
-
144
- def raise_on_missing_translations_in(environment)
145
- config = 'config.action_view.raise_on_missing_translations = true'
146
-
147
- uncomment_lines("config/environments/#{environment}.rb", config)
148
- end
149
146
  end
150
147
  end
@@ -20,6 +20,7 @@ module Startblock
20
20
  def startblock_customization
21
21
  invoke :customize_gemfile
22
22
  invoke :setup_development_environment
23
+ invoke :setup_development_environment
23
24
  invoke :setup_testing_environment
24
25
  invoke :setup_staging_environment
25
26
  invoke :setup_secret_token
@@ -48,7 +49,11 @@ module Startblock
48
49
  build :raise_on_delivery_errors
49
50
  build :raise_on_unpermitted_parameters
50
51
  build :provide_setup_script
51
- build :configure_i18n_for_missing_translations
52
+ end
53
+
54
+ def customize_applicationrb
55
+ say 'Configuring application.rb'
56
+ build :disable_helper_generation
52
57
  end
53
58
 
54
59
  def setup_testing_environment
@@ -1,5 +1,5 @@
1
1
  module Startblock
2
2
  RAILS_VERSION = "~> 4.2"
3
3
  RUBY_VERSION = IO.read("#{File.dirname(__FILE__)}/../../.ruby-version").strip
4
- VERSION = "1.4"
4
+ VERSION = "1.5"
5
5
  end
@@ -28,7 +28,7 @@ end
28
28
  group :development, :test do
29
29
  gem "awesome_print"
30
30
  gem "dotenv-rails"
31
- gem "rubocop"
31
+ gem "rubocop", "~> 0.32"
32
32
  end
33
33
 
34
34
  group :test do
@@ -37,6 +37,9 @@ group :test do
37
37
  gem "timecop"
38
38
  gem "shoulda"
39
39
  gem "mocha"
40
+ gem "launchy"
41
+ gem "poltergeist"
42
+ gem "database_cleaner"
40
43
  end
41
44
 
42
45
  group :staging, :production do
@@ -1,4 +1,3 @@
1
-
2
1
  ENV['RAILS_ENV'] ||= 'test'
3
2
  require File.expand_path('../../config/environment', __FILE__)
4
3
  require 'rails/test_help'
@@ -9,19 +8,64 @@ require 'minitest/mock'
9
8
  require "mocha/mini_test"
10
9
  require "minitest/rails/capybara"
11
10
  require "minitest/reporters"
11
+ require "database_cleaner"
12
+ require 'capybara/poltergeist'
12
13
 
13
14
  Sidekiq::Testing.fake!
14
- Minitest::Reporters.use! Minitest::Reporters::ProgressReporter.new
15
+
16
+ reporter_options = { color: true, slow_count: 5 }
17
+ Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(reporter_options)]
18
+
19
+ DatabaseCleaner.strategy = :transaction
20
+
21
+ # Requires supporting ruby files with custom matchers and macros, etc,
22
+ # in test/support/ and its subdirectories.
23
+ Dir[Rails.root.join("test/support/**/*.rb")].each { |f| require f }
15
24
 
16
25
  class ActiveSupport::TestCase
17
26
  # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
18
27
  fixtures :all
28
+
29
+ def self.check_for_valid_fixtures(name)
30
+ Object.const_get(name.to_s.camelize).all.each do |obj|
31
+ raise "Fixtures for #{name} should be valid - #{obj.errors.messages}" unless obj.valid?
32
+ end
33
+ end
19
34
  end
20
35
 
21
36
  class ActionDispatch::IntegrationTest
22
37
  include Capybara::DSL
38
+
39
+ use_transactional_fixtures = false
40
+
41
+
42
+ Capybara.register_driver :poltergeist do |app|
43
+ Capybara::Poltergeist::Driver.new(app, js_errors: true)
44
+ end
45
+ Capybara.javascript_driver = :poltergeist
46
+
47
+ setup do
48
+ DatabaseCleaner.strategy = :truncation
49
+ DatabaseCleaner.start
50
+ end
51
+
23
52
  teardown do
24
53
  Capybara.reset_sessions!
25
54
  Capybara.use_default_driver
55
+ DatabaseCleaner.clean
56
+ end
57
+
58
+ def wait_for_ajax
59
+ Timeout.timeout(Capybara.default_max_wait_time) do
60
+ loop until finished_all_ajax_requests?
61
+ end
62
+ end
63
+
64
+ def finished_all_ajax_requests?
65
+ page.evaluate_script('jQuery.active').zero?
66
+ end
67
+
68
+ def use_javascript
69
+ Capybara.current_driver = Capybara.javascript_driver
26
70
  end
27
71
  end
@@ -80,4 +80,11 @@ class NewProjectTest < Minitest::Test
80
80
 
81
81
  assert development_rb_file.match(/letter_opener/), "Should have the letter opener"
82
82
  end
83
+
84
+ def test_helper_generation_should_be_disabled
85
+ application_rb_file = IO.read("#{project_path}/config/application.rb")
86
+
87
+ assert application_rb_file.match("config.generators.stylesheets = false"),
88
+ "Should disable stylesheet generation"
89
+ end
83
90
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: startblock
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.4'
4
+ version: '1.5'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeroen van Baarsen
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-29 00:00:00.000000000 Z
12
+ date: 2016-02-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest