Skip to content

Instantly share code, notes, and snippets.

@fofr
Created September 18, 2017 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fofr/ea3b60362f1cdf200c3090f6df98bc88 to your computer and use it in GitHub Desktop.
Save fofr/ea3b60362f1cdf200c3090f6df98bc88 to your computer and use it in GitHub Desktop.
test_helper.rb
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