Created
September 18, 2017 11:34
-
-
Save fofr/ea3b60362f1cdf200c3090f6df98bc88 to your computer and use it in GitHub Desktop.
test_helper.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENV['RAILS_ENV'] ||= 'test' | |
require File.expand_path("../../test/dummy/config/environment.rb", __FILE__) | |
# Rails isn't picking up the RAILS_ENV var | |
# Without this line env is set to development | |
Rails.env = ENV['RAILS_ENV'] | |
require 'capybara/rails' | |
require 'capybara/poltergeist' | |
require 'slimmer/test' | |
require 'slimmer/test_helpers/govuk_components' | |
require 'webmock/minitest' | |
Capybara.default_driver = Capybara.javascript_driver = :poltergeist | |
WebMock.disable_net_connect!(allow_localhost: true) | |
class ActionDispatch::IntegrationTest | |
include Capybara::DSL | |
include Slimmer::TestHelpers::GovukComponents | |
def setup | |
stub_shared_component_locales | |
end | |
end | |
require 'govuk_publishing_components/minitest/component_guide_test' | |
class ComponentGuideTestTest < ActionDispatch::IntegrationTest | |
include GovukPublishingComponents::Minitest::ComponentGuideTest | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment