Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. ENV['RAILS_ENV'] ||= 'test'
  2. require File.expand_path('../../config/environment', __FILE__)
  3. require 'rails/test_help'
  4. require 'capybara'
  5. require 'capybara/dsl'
  6. require 'vcr'
  7.  
  8. class ActiveSupport::TestCase
  9. include Devise::Test::IntegrationHelpers
  10. # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
  11. fixtures :all
  12.  
  13. # Add more helper methods to be used by all tests here...
  14. VCR.configure do |c|
  15. c.hook_into :webmock
  16. c.cassette_library_dir = 'vcr_cassettes'
  17. c.default_cassette_options = { :record => :once }
  18. end
  19. end
  20.  
  21. class ActionDispatch::IntegrationTest
  22. # Make the Capybara DSL available in all integration tests
  23. include Capybara::DSL
  24.  
  25. # Reset sessions and driver between tests
  26. # Use super wherever this method is redefined in your individual test classes
  27. def teardown
  28. Capybara.reset_sessions!
  29. Capybara.use_default_driver
  30. end
  31. end
  32.  
  33. test "signed in user can visit portfolio index page" do
  34. @user = users(:nicholas)
  35. sign_in @user
  36. visit portfolios_path
  37. assert_select "h1", "Portfolios"
  38. end
  39.  
  40. ArgumentError: rack-test requires a rack application, but none was given
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement