From 7c70a36d8099585d63acf75bbb11d29b59852a16 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Mon, 20 Jul 2015 11:58:33 -0500 Subject: [PATCH] * allow youtube_spec to be excluded by build server --- web/spec/features/youtube_spec.rb | 2 +- web/spec/spec_helper.rb | 4 ++++ web/spec/support/utilities.rb | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/web/spec/features/youtube_spec.rb b/web/spec/features/youtube_spec.rb index 6fc694e0b..0f3d88741 100644 --- a/web/spec/features/youtube_spec.rb +++ b/web/spec/features/youtube_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' require 'google_client' require 'rest_client' -describe "YouTube", :slow=>true, :js=>true, :type => :feature, :capybara_feature => true do +describe "YouTube", :slow=>true, :js=>true, :type => :feature, :capybara_feature => true, dev_env_only: true do subject { page } # Authenticate with a test google account. This should create diff --git a/web/spec/spec_helper.rb b/web/spec/spec_helper.rb index fde6f6159..9ab730beb 100644 --- a/web/spec/spec_helper.rb +++ b/web/spec/spec_helper.rb @@ -54,6 +54,8 @@ RecordedTrack.observers.disable :all # only a few tests want this observer activ require "test/unit" Test::Unit::AutoRunner.need_auto_run = false +IS_BUILD_SERVER = !ENV['BUILD_SERVER'].nil? + # a way to kill tests if they aren't running. capybara is hanging intermittently, I think tests_started = false @@ -175,6 +177,8 @@ bputs "before register capybara" config.filter_run_excluding slow: true unless ENV['RUN_SLOW_TESTS'] == "1" || ENV['SLOW'] == "1" || ENV['ALL_TESTS'] == "1" config.filter_run_excluding aws: true unless ENV['RUN_AWS_TESTS'] == "1" || ENV['AWS'] == "1" || ENV['ALL_TESTS'] == "1" + config.filter_run_excluding dev_env_only: true if IS_BUILD_SERVER + # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures config.fixture_path = "#{::Rails.root}/spec/fixtures" diff --git a/web/spec/support/utilities.rb b/web/spec/support/utilities.rb index 4bc1f1ba5..eeed0520b 100644 --- a/web/spec/support/utilities.rb +++ b/web/spec/support/utilities.rb @@ -88,7 +88,7 @@ def authorize_google_user(youtube_client, user, google_password) end url = youtube_client.get_login_url(user.email) - puts("Login URL: #{url}") + #puts("Login URL: #{url}") visit url sleep(1) @@ -103,6 +103,7 @@ def authorize_google_user(youtube_client, user, google_password) # Wait for submit to enable and then click it: sleep(5) + save_screenshot("about_to_submit.png") find('#submit_approve_access').trigger(:click) sleep(5)