Guest User

Untitled

a guest
Jan 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. require 'test_helper'
  2.  
  3. class TweetranslateTest < ActionDispatch::IntegrationTest
  4. include Capybara::DSL
  5.  
  6. setup do
  7. OmniAuth.config.test_mode = true
  8. OmniAuth.config.mock_auth[:twitter] = {
  9. 'uid' => '123545',
  10. 'user_info' => {'nickname' => 'matz_traducido'},
  11. 'credentials' => {'token' => '70k3n', 'secret' => 's3cr37'}
  12. }
  13. end
  14.  
  15. test "associate twitter account for translation of tweets" do
  16. visit '/'
  17. click_link 'Twitter'
  18. assert page.has_content?('Signed in')
  19.  
  20. fill_in '@', :with => "yukihiro_matz"
  21. select 'japanese', :from => 'Translate from:'
  22. select 'spanish', :from => 'Translate to:'
  23. click_button 'Finish'
  24. assert page.has_content?('Twitter account is now associated for translations!')
  25. end
  26.  
  27. test "de-associate twitter account" do
  28. visit '/'
  29. click_link 'Twitter'
  30. assert page.has_content?('Signed in')
  31.  
  32. click_link 'X'
  33.  
  34. assert page.has_content?('Twitter account de-associated')
  35. end
  36. end
Add Comment
Please, Sign In to add comment