Guest User

Untitled

a guest
Dec 15th, 2017
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. FAIL["test_profile_display", UsersProfileTest, 1.204680988099426]
  2. test_profile_display#UsersProfileTest (1.20s)
  3. <Michael Example | Ruby on Rails Tutorial Sample App> expected but was
  4. <Michael ExampleMichael Example | Ruby on Rails Tutorial Sample App>..
  5. Expected 0 to be >= 1.
  6. test/integration/users_profile_test.rb:13:in `block in <class:UsersProfileTest>'
  7.  
  8. require 'test_helper'
  9.  
  10. class UsersProfileTest < ActionDispatch::IntegrationTest
  11. include ApplicationHelper
  12.  
  13. def setup
  14. @user = users(:michael)
  15. end
  16.  
  17. test "profile display" do
  18. get user_path(@user)
  19. assert_template 'users/show'
  20. assert_select 'title', full_title(@user.name)
  21. assert_select 'h1', text: @user.name
  22. assert_select 'h1>img.gravatar'
  23. assert_match @user.microposts.count.to_s, response.body
  24. assert_select 'div.pagination'
  25. @user.microposts.paginate(page: 1).each do |micropost|
  26. assert_match micropost.content, response.body
  27. end
  28. end
  29. end
  30.  
  31. assert_select 'title', full_title(@user.name)
  32.  
  33. michael:
  34. name: Michael Example
  35. email: michael@example.com
  36. password_digest: <%= User.digest('password') %>
  37. admin: true
  38. activated: true
  39. activated_at: <%= Time.zone.now %>
  40. .
  41. .
  42. .
  43.  
  44. module ApplicationHelper
  45.  
  46. # Returns the full title on a per-page basis.
  47. def full_title(page_title = '')
  48. base_title = "Ruby on Rails Tutorial Sample App"
  49. if page_title.empty?
  50. base_title
  51. else
  52. page_title + " | " + base_title
  53. end
  54. end
  55. end
Add Comment
Please, Sign In to add comment