Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ENV['RAILS_ENV'] ||= 'test'
- require File.expand_path('../../config/environment', __FILE__)
- require 'rails/test_help'
- require 'capybara'
- require 'capybara/dsl'
- require 'vcr'
- class ActiveSupport::TestCase
- include Devise::Test::IntegrationHelpers
- # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
- fixtures :all
- # Add more helper methods to be used by all tests here...
- VCR.configure do |c|
- c.hook_into :webmock
- c.cassette_library_dir = 'vcr_cassettes'
- c.default_cassette_options = { :record => :once }
- end
- end
- class ActionDispatch::IntegrationTest
- # Make the Capybara DSL available in all integration tests
- include Capybara::DSL
- # Reset sessions and driver between tests
- # Use super wherever this method is redefined in your individual test classes
- def teardown
- Capybara.reset_sessions!
- Capybara.use_default_driver
- end
- end
- test "signed in user can visit portfolio index page" do
- @user = users(:nicholas)
- sign_in @user
- visit portfolios_path
- assert_select "h1", "Portfolios"
- end
- ArgumentError: rack-test requires a rack application, but none was given
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement