Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ERROR["test_non-signed_in_user_layout_links", SiteLayoutTest, 1.3199719070007632]
- test_non-signed_in_user_layout_links#SiteLayoutTest (1.32s)
- ActionView::Template::Error: ActionView::Template::Error: undefined method `name' for nil:NilClass
- app/views/pins/_pin.html.erb:2:in `_app_views_pins__pin_html_erb___3167554587389080103_47088431630420'
- app/views/static_pages/home.html.erb:6:in `_app_views_static_pages_home_html_erb___4092361779176196837_47088431162360'
- test/integration/site_layout_test.rb:10:in `block in <class:SiteLayoutTest>'
- ERROR["test_signed_in_user_layout_links", SiteLayoutTest, 2.0834625150000647]
- test_signed_in_user_layout_links#SiteLayoutTest (2.08s)
- ActionView::Template::Error: ActionView::Template::Error: undefined method `name' for nil:NilClass
- app/views/pins/_pin.html.erb:2:in `_app_views_pins__pin_html_erb___3167554587389080103_47088457226940'
- app/views/static_pages/home.html.erb:6:in `_app_views_static_pages_home_html_erb___4092361779176196837_47088457198480'
- test/integration/site_layout_test.rb:24:in `block in <class:SiteLayoutTest>'
- ERROR["test_should_get_home", StaticPagesControllerTest, 2.1026109900003576]
- test_should_get_home#StaticPagesControllerTest (2.10s)
- ActionView::Template::Error: ActionView::Template::Error: undefined method `name' for nil:NilClass
- app/views/pins/_pin.html.erb:2:in `_app_views_pins__pin_html_erb___3167554587389080103_47088457310920'
- app/views/static_pages/home.html.erb:6:in `_app_views_static_pages_home_html_erb___4092361779176196837_47088457291840'
- test/controllers/static_pages_controller_test.rb:9:in `block in <class:StaticPagesControllerTest>'
- require 'test_helper'
- class SiteLayoutTest < ActionDispatch::IntegrationTest
- def setup
- ActionMailer::Base.deliveries.clear
- @user = users(:john)
- end
- test "non-signed in user layout links" do
- get root_path
- assert_template 'static_pages/home'
- assert_select "a[href=?]", root_path, count: 2
- assert_select "a[href=?]", about_path
- assert_select "a[href=?]", new_user_session_path, count: 2
- assert_select "a[href=?]", new_user_registration_path, count: 1
- end
- test "signed in user layout links" do
- get new_user_session_path
- assert_template 'devise/sessions/new'
- post user_session_path, params: { user: { email: @user.email, password: 'password' } }
- assert_not flash.empty?
- assert_redirected_to root_path
- follow_redirect!
- assert_template 'static_pages/home'
- assert_select "a[href=?]", new_user_session_path, count: 0
- assert_select "a[href=?]", new_user_registration_path, count: 0
- assert_select "a[href=?]", edit_user_registration_path
- assert_select "a[href=?]", destroy_user_session_path
- assert_select "a[href=?]", new_pin_path
- end
- end
- require 'test_helper'
- class StaticPagesControllerTest < ActionDispatch::IntegrationTest
- def setup
- @user = users(:john)
- end
- test "should get home" do
- get root_url
- assert_response :success
- assert_select "title", full_title
- end
- test "should get about" do
- get about_url
- assert_response :success
- assert_select "title", full_title("About")
- end
- end
- john:
- name: John Rockefeller
- email: john@rockefeller.com
- encrypted_password: <%= Devise::Encryptor.digest(User, 'password') %>
- created_at: <%= Time.zone.now %>
- andrew:
- name: Andrew Carnegie
- email: andrew@carnegie.com
- encrypted_password: <%= Devise::Encryptor.digest(User, 'password') %>
- created_at: <%= Time.zone.now %>
- quote:
- description: "Lorem quote"
- created_at: <%= 10.minutes.ago %>
- user: john
- recipe:
- description: "Lorem recipe"
- created_at: <%= 3.years.ago %>
- most_recent:
- description: "Lorem most recent"
- created_at: <%= Time.zone.now %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement