diff options
-rw-r--r-- | app/helpers/commits_helper.rb | 2 | ||||
-rw-r--r-- | app/helpers/projects_helper.rb | 2 | ||||
-rw-r--r-- | config/initializers/haml.rb | 6 | ||||
-rw-r--r-- | doc/administration/environment_variables.md | 1 | ||||
-rw-r--r-- | features/support/capybara.rb | 8 | ||||
-rw-r--r-- | spec/models/concerns/case_sensitivity_spec.rb | 12 | ||||
-rw-r--r-- | spec/support/capybara.rb | 6 | ||||
-rw-r--r-- | spec/support/test_env.rb | 17 |
8 files changed, 41 insertions, 13 deletions
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index 53f8f913b33..1d14ee52cfc 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -152,7 +152,7 @@ module CommitsHelper options = { class: "commit-#{options[:source]}-link has_tooltip", - data: { 'original-title': sanitize(source_email) } + data: { 'original-title'.to_sym => sanitize(source_email) } } if user.nil? diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index f70a0f3adf2..8c8b355028c 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -40,7 +40,7 @@ module ProjectsHelper link_to(author_html, user_path(author), class: "author_link").html_safe else title = opts[:title].sub(":name", sanitize(author.name)) - link_to(author_html, user_path(author), class: "author_link has_tooltip", data: { 'original-title': title, container: 'body' } ).html_safe + link_to(author_html, user_path(author), class: "author_link has_tooltip", data: { 'original-title'.to_sym => title, container: 'body' } ).html_safe end end diff --git a/config/initializers/haml.rb b/config/initializers/haml.rb index 7e8ddb3716b..1516476815a 100644 --- a/config/initializers/haml.rb +++ b/config/initializers/haml.rb @@ -1 +1,7 @@ Haml::Template.options[:ugly] = true + +# Remove the `:coffee` and `:coffeescript` filters +# +# See https://git.io/vztMu and http://stackoverflow.com/a/17571242/223897 +Haml::Filters.remove_filter('coffee') +Haml::Filters.remove_filter('coffeescript') diff --git a/doc/administration/environment_variables.md b/doc/administration/environment_variables.md index 42a27dcf6d6..0faef526d43 100644 --- a/doc/administration/environment_variables.md +++ b/doc/administration/environment_variables.md @@ -47,6 +47,7 @@ GITLAB_DATABASE_PORT | 5432 ## Adding more variables We welcome merge requests to make more settings configurable via variables. +Please make changes in the file config/initializers/1_settings.rb Please stick to the naming scheme "GITLAB_#{name 1_settings.rb in upper case}". ## Omnibus configuration diff --git a/features/support/capybara.rb b/features/support/capybara.rb index 4156c7ec484..38069ff8835 100644 --- a/features/support/capybara.rb +++ b/features/support/capybara.rb @@ -9,10 +9,6 @@ Capybara.register_driver :poltergeist do |app| Capybara::Poltergeist::Driver.new(app, js_errors: true, timeout: timeout) end -Spinach.hooks.on_tag("javascript") do - Capybara.current_driver = Capybara.javascript_driver -end - Capybara.default_wait_time = timeout Capybara.ignore_hidden_elements = false @@ -22,3 +18,7 @@ unless ENV['CI'] || ENV['CI_SERVER'] # Keep only the screenshots generated from the last failing test suite Capybara::Screenshot.prune_strategy = :keep_last_run end + +Spinach.hooks.before_run do + TestEnv.warm_asset_cache +end diff --git a/spec/models/concerns/case_sensitivity_spec.rb b/spec/models/concerns/case_sensitivity_spec.rb index 6535246bf2d..92fdc5cd65d 100644 --- a/spec/models/concerns/case_sensitivity_spec.rb +++ b/spec/models/concerns/case_sensitivity_spec.rb @@ -37,7 +37,7 @@ describe CaseSensitivity, models: true do with(%q{LOWER("foo"."bar") = LOWER(:value)}, value: 'bar'). and_return(criteria) - expect(model.iwhere('foo.bar': 'bar')).to eq(criteria) + expect(model.iwhere('foo.bar'.to_sym => 'bar')).to eq(criteria) end end @@ -87,8 +87,8 @@ describe CaseSensitivity, models: true do with(%q{LOWER("foo"."baz") = LOWER(:value)}, value: 'baz'). and_return(final) - got = model.iwhere('foo.bar': 'bar', - 'foo.baz': 'baz') + got = model.iwhere('foo.bar'.to_sym => 'bar', + 'foo.baz'.to_sym => 'baz') expect(got).to eq(final) end @@ -127,7 +127,7 @@ describe CaseSensitivity, models: true do with(%q{`foo`.`bar` = :value}, value: 'bar'). and_return(criteria) - expect(model.iwhere('foo.bar': 'bar')). + expect(model.iwhere('foo.bar'.to_sym => 'bar')). to eq(criteria) end end @@ -178,8 +178,8 @@ describe CaseSensitivity, models: true do with(%q{`foo`.`baz` = :value}, value: 'baz'). and_return(final) - got = model.iwhere('foo.bar': 'bar', - 'foo.baz': 'baz') + got = model.iwhere('foo.bar'.to_sym => 'bar', + 'foo.baz'.to_sym => 'baz') expect(got).to eq(final) end diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index fed1ab6ee33..a698f484df1 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -19,3 +19,9 @@ unless ENV['CI'] || ENV['CI_SERVER'] # Keep only the screenshots generated from the last failing test suite Capybara::Screenshot.prune_strategy = :keep_last_run end + +RSpec.configure do |config| + config.before(:suite) do + TestEnv.warm_asset_cache + end +end diff --git a/spec/support/test_env.rb b/spec/support/test_env.rb index 4f4743bff6d..0d1bd030f3c 100644 --- a/spec/support/test_env.rb +++ b/spec/support/test_env.rb @@ -146,6 +146,22 @@ module TestEnv FileUtils.chmod_R 0755, target_repo_path end + # When no cached assets exist, manually hit the root path to create them + # + # Otherwise they'd be created by the first test, often timing out and + # causing a transient test failure + def warm_asset_cache + return if warm_asset_cache? + return unless defined?(Capybara) + + Capybara.current_session.driver.visit '/' + end + + def warm_asset_cache? + cache = Rails.root.join(*%w(tmp cache assets test)) + Dir.exist?(cache) && Dir.entries(cache).length > 2 + end + private def factory_repo_path @@ -172,7 +188,6 @@ module TestEnv 'gitlab-test-fork' end - # Prevent developer git configurations from being persisted to test # repositories def git_env |