- Choose one of the following tracks:
- Skim/Read through the associated links
- Attempt to hook up and implement unit or feature js tests in your IdeaBox or this sample idea-bin project
- Fork this gist
- Respond with:
- Your experience implementing
- Were you successful?
- Links to commits on Github or copy and pasted code snippits of a test
/1602-testing-homework.markdown Secret
Created
June 29, 2016 07:38
-
-
Save chadellison/3466e43da0104ef8e7d3351198d389bd to your computer and use it in GitHub Desktop.
Testing Homework
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My experience implementing the feature tests was painful as warned. I gave it a solid three hours trying a variety of different things. I believe I have everything setup correctly in my rails helper and feature tests. I was so close to getting it to work; so I thought. I installed firefox and adjusted versions of the selenium gem. After getting everything setup correctly my current version of firefox is not working with the capybara selenium web driver. If I have time, I will have another go at it.
I was unsuccessful.
snippets:
module WaitForAjax
def wait_for_ajax
Timeout.timeout(Capybara.default_max_wait_time) do
loop until finished_all_ajax_requests?
end
end
end
RSpec.configure do |config|
config.include WaitForAjax, type: :feature
end
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
config.before(:each, :js => true) do
DatabaseCleaner.strategy = :truncation
end
config.before(:each) do
DatabaseCleaner.start
end
config.after(:each) do
DatabaseCleaner.clean
end
Snippet from test:
scenario "User sees ideas", js: true do