Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FAIL["test_profile_display", UsersProfileTest, 1.204680988099426]
- test_profile_display#UsersProfileTest (1.20s)
- <Michael Example | Ruby on Rails Tutorial Sample App> expected but was
- <Michael ExampleMichael Example | Ruby on Rails Tutorial Sample App>..
- Expected 0 to be >= 1.
- test/integration/users_profile_test.rb:13:in `block in <class:UsersProfileTest>'
- require 'test_helper'
- class UsersProfileTest < ActionDispatch::IntegrationTest
- include ApplicationHelper
- def setup
- @user = users(:michael)
- end
- test "profile display" do
- get user_path(@user)
- assert_template 'users/show'
- assert_select 'title', full_title(@user.name)
- assert_select 'h1', text: @user.name
- assert_select 'h1>img.gravatar'
- assert_match @user.microposts.count.to_s, response.body
- assert_select 'div.pagination'
- @user.microposts.paginate(page: 1).each do |micropost|
- assert_match micropost.content, response.body
- end
- end
- end
- assert_select 'title', full_title(@user.name)
- michael:
- name: Michael Example
- email: michael@example.com
- password_digest: <%= User.digest('password') %>
- admin: true
- activated: true
- activated_at: <%= Time.zone.now %>
- .
- .
- .
- module ApplicationHelper
- # Returns the full title on a per-page basis.
- def full_title(page_title = '')
- base_title = "Ruby on Rails Tutorial Sample App"
- if page_title.empty?
- base_title
- else
- page_title + " | " + base_title
- end
- end
- end
Add Comment
Please, Sign In to add comment